How to sort Data in XML template (rtf) file?

Hi, I have an oracle 11i custom report (rdf) with an xml output to a PDF. There is a formula column in the report. Now I need the data to be sorted on this formula column. As we cannot sort on formula column, i have decided to find a way to sort it in the data in the XML template. But I don't really know how to sort and also where to specify the sort tag in the rtf file. I appreciate your response.
Databse version :
E-Biz Version :
Oracle Reports Version :
Oracle BI version :
Note : I posted this question under : XML General forum also. But did not get any response. I assumed that may be thats not the right place to post it as my report is in e-Biz environment.

As long as you don't have your ^field commands grouped inside a ^group the order in the .dat file is not important. Your last command
^field BG_DOC_LN__LN_AM
should populate field BG_DOC_LN_AM wherever you place it on your form. Obviously you need to name the fields according to your ^field commands and not just use tab (move to next field).
Shout if this was not what you are asking.
Stale Sodal