<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>

[{'answer_id': 49887, 'author': 'Pierre Spring', 'author_id': 1532, 'author_profile': 'https://Stackoverflow.com/users/1532', 'pm_score': 2, 'selected': False, 'text': '<p>You can do this, using <code>xsl:sort</code>. It is important to set the <code>data-type="number"</code> because else, the position will be sorted as a string, end therefor, the 10th node would ge considered before the 2nd one.</p>\n\n<pre><code>&lt;xsl:template match="/"&gt;\n    &lt;xsl:apply-templates select="root/node"&gt;\n        &lt;xsl:sort \n            select="position()" \n            order="descending" \n            data-type="number"/&gt;\n    &lt;/xsl:apply-templates&gt;\n&lt;/xsl:template&gt;\n&lt;xsl:template match="node"&gt;\n    &lt;xsl:value-of select="."/&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n'}, {'answer_id': 49893, 'author': 'samjudson', 'author_id': 1908, 'author_profile': 'https://Stackoverflow.com/users/1908', 'pm_score': 6, 'selected': True, 'text': '<p>Easy!</p>\n\n<pre><code>&lt;xsl:template match="/"&gt;\n    &lt;xsl:apply-templates select="root/node"&gt;\n        &lt;xsl:sort select="position()" data-type="number" order="descending"/&gt;\n    &lt;/xsl:apply-templates&gt;\n&lt;/xsl:template&gt;\n\n&lt;xsl:template match="node"&gt;\n    &lt;xsl:value-of select="."/&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n'}, {'answer_id': 50015246, 'author': 'imran', 'author_id': 9665536, 'author_profile': 'https://Stackoverflow.com/users/9665536', 'pm_score': 0, 'selected': False, 'text': '<pre><code>&lt;xsl:template match="/"&gt;\n        &lt;xsl:apply-templates select="root/node[3]"/&gt;\n        &lt;xsl:apply-templates select="root/node[2]"/&gt;\n        &lt;xsl:apply-templates select="root/node[1]"/&gt;\n    &lt;/xsl:template&gt;\n    &lt;xsl:template match="node"&gt;\n        &lt;xsl:value-of select="."/&gt;\n    &lt;/xsl:template&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/49883', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1532/']