How Do I Retrieve Data from an XML Doc in a Preferred Order? (Magic xpa 3.x)
It is important to remember that the XML view simply creates a temporary table in which to store the XML data. Since it is a temporary table, you can add indexes if you wish, and use those indexes as you would for any data source.

-
In the Data repository, select the XML view you want to work with.
-
Click on the Indexes tab.
-
Press F4 to create a new index line.
-
Type in a name for your index. Tab to the right.
-
In the Type column, select Non-unique if it is not a unique index.
-
Click on the Segments area (lower left part of the screen). Press F4 to open up a line.
-
Press F5 to zoom to the list of fields. Select the field you want to sort on.
-
Repeat steps 6 and 7 for more index segments, if desired.
Now, when you use your new index in a program, the data will be presented in the order according to that index.
The Online and Rich Client Samples projects (program XM07 and RXM07)