Hi,
For more advanced sorting, you can use a stage and the Analytic / Ranking functions of your the Database to generate a key corresponding to your sort for each of your lines.
Here is an example with Microsoft SQL Server:
1. Add a stage between your source table and your target XML File
2. Map your source fields in the stage
3. Add a new column on the stage, with the analytic function corresponding to the wanted sort as expression
4. Map this column to the repetition key of your XML Node
The expression used in the sortKey column here is:
ROW_NUMBER() OVER (ORDER BY CUS_NAME DESC)
Explanation:
This expression will tell SQL Server to generate a number for each row, with the order defined in the condition.
We are then using this "sorted" column on the XML Node repetition key.
Please refer to the documentation of your database to find the correct function / syntax to perform this.
For SQL Server:
msdn.microsoft.com/en-us/library/ms186734.aspx