<p>Say I have this given XML file:</p>

<pre><code>&lt;root&gt;
    &lt;node&gt;x&lt;/node&gt;
    &lt;node&gt;y&lt;/node&gt;
    &lt;node&gt;a&lt;/node&gt;
&lt;/root&gt;
</code></pre>

<p>And I want the following to be displayed:</p>

<pre><code>ayx
</code></pre>

<p>Using something similar to:</p>

<pre><code>&lt;xsl:template match="/"&gt;
    &lt;xsl:apply-templates select="root/node"/&gt;
&lt;/xsl:template&gt;
&lt;xsl:template match="node"&gt;
    &lt;xsl:value-of select="."/&gt;
&lt;/xsl:template&gt;
</code></pre>

You can do this, using
```
xsl:sort
```
. It is important to set the
```
data-type="number"
```
because else, the position will be sorted as a string, end therefor, the 10th node would ge considered before the 2nd one.
```
```
<xsl:template match="/">
    <xsl:apply-templates select="root/node">
        <xsl:sort 
            select="position()" 
            order="descending" 
            data-type="number"/>
    </xsl:apply-templates>
</xsl:template>
<xsl:template match="node">
    <xsl:value-of select="."/>
</xsl:template>
```
```