in order to use xsl to transform xml and sort it, you need:
a) the xsl attributes to select the sort method
b) the xsl script that does the actual sorting based on these attributes
c) a method of passing the attributes to teh xsl
c) is where most people get hung up.
if you're having the transformation run clientside, then usually you need to have the transformation run via javascript and use this to inject the attributes for sorting
if the transformation is clientside, then use php to inject the attributes.
if you're still stuck, then post some sample xml, the xsl, and whatever method you are using to combine them.