Это преобразование :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="TRANSACTIONS">
<TRANSACTIONS>
<xsl:apply-templates>
<xsl:sort select="@POSTED-DATE"/>
</xsl:apply-templates>
</TRANSACTIONS>
</xsl:template>
</xsl:stylesheet>
при применении к предоставленному документу XML:
<DATA RESULT="TRUE">
<ACCOUNT NUMBER="MyNumber" CURRENCY="MyCurrency" TYPE="MyType" />
<TRANSACTIONS>
<TRANSACTION DESCRIPTION="DESC 1"
CURRENCY="USD"
POSTED-DATE="2010/01/31" AMOUNT="240.88" />
<TRANSACTION DESCRIPTION="DESC 3"
CURRENCY="USD"
POSTED-DATE="2010/05/20" AMOUNT="240.88" />
<TRANSACTION DESCRIPTION="DESC 8"
CURRENCY="USD"
POSTED-DATE="2008/12/31" AMOUNT="240.88" />
<TRANSACTION DESCRIPTION="DESC 3"
CURRENCY="USD"
POSTED-DATE="2003/12/31" AMOUNT="240.88" />
<TRANSACTION DESCRIPTION="DESC 99"
CURRENCY="USD"
POSTED-DATE="2011/01/01" AMOUNT="240.88" />
<TRANSACTION DESCRIPTION="DESC 999"
CURRENCY="USD"
POSTED-DATE="2011/01/06" AMOUNT="240.88" />
</TRANSACTIONS>
</DATA>
дает желаемый, правильный результат :
<DATA RESULT="TRUE">
<ACCOUNT NUMBER="MyNumber" CURRENCY="MyCurrency" TYPE="MyType"/>
<TRANSACTIONS>
<TRANSACTION DESCRIPTION="DESC 3"
CURRENCY="USD"
POSTED-DATE="2003/12/31" AMOUNT="240.88"/>
<TRANSACTION DESCRIPTION="DESC 8"
CURRENCY="USD"
POSTED-DATE="2008/12/31" AMOUNT="240.88"/>
<TRANSACTION DESCRIPTION="DESC 1"
CURRENCY="USD"
POSTED-DATE="2010/01/31" AMOUNT="240.88"/>
<TRANSACTION DESCRIPTION="DESC 3"
CURRENCY="USD"
POSTED-DATE="2010/05/20" AMOUNT="240.88"/>
<TRANSACTION DESCRIPTION="DESC 99"
CURRENCY="USD"
POSTED-DATE="2011/01/01" AMOUNT="240.88"/>
<TRANSACTION DESCRIPTION="DESC 999"
CURRENCY="USD"
POSTED-DATE="2011/01/06" AMOUNT="240.88"/>
</TRANSACTIONS>
</DATA>