The <sortby> tag is a container for all the sorting directives, which specify how the targeting results should be sorted. You can include a sorting directive that has been previously defined, or which is defined dynamically, using the src attribute with the <sortby> tag. See Including Rule Sets, Rules, and Sorting Directives.

The <sortby> tag must either use the src attribute or have at least one child. Each child must be a <sortbyvalue> tag. The order of the child <sortbyvalue> tags implies the sorting order: that is, the first child defines the primary sorting criterion, the second child defines the secondary sorting criterion, and so forth.

The <sortby> tag must be matched by a closing </sortby> tag.