1<?xml version="1.0"?> 2 3<!-- reassembles an xml tree in reverse order --> 4 5<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 6 7<xsl:output encoding="utf-8"/> 8 9<xsl:template match="*"> 10 <xsl:copy> 11 <xsl:apply-templates select="node()"> 12 <xsl:sort select="position()" data-type="number" order="descending"/> 13 </xsl:apply-templates> 14 </xsl:copy> 15</xsl:template> 16 17</xsl:stylesheet> 18 19