I was using an XSL style sheet to do the sorting but it seems to be very slow. Is there a more efficient way?
It is a flat list of nodes, if I convert the nodes to an object and sort in a GenericList would it help?
EDIT I don’t need the end result to be XML.
Do it with xsl using an XslCompiledTransform, but make sure you cache the XslCompiledTransform because the compilation is slow, execution is extremely fast.
So:
This is bloody fast, keeps your code clean and you’re flexible when it comes to changing the sort implementation; it’s just editing a single xsl.
I type this without checking it so there may be typo’s but this is how you should go about:
And to transform use a method somewhere like this: