title: Sort nodes of a XML file
body: <p>Sorting is giving me a hard time.</p>
  <p>I need help with an small example, so that I can understand xsl:sort better.</p>
  <p>My xml data looks as followed:</p>
  <pre><code>&lt;NewTerms&gt;
    &lt;newTerm&gt;Zebra&lt;/newTerm&gt;
    &lt;newTerm&gt;Horse&lt;/newTerm&gt;
    &lt;newTerm&gt;Cat&lt;/newTerm&gt;
    &lt;newTerm&gt;Lion&lt;/newTerm&gt;
    &lt;newTerm&gt;Jaguar&lt;/newTerm&gt;
    &lt;newTerm&gt;Cheetah&lt;/newTerm&gt;
    &lt;newTerm&gt;Deer&lt;/newTerm&gt;
    &lt;newTerm&gt;Buffalo&lt;/newTerm&gt;
    &lt;newTerm&gt;Dog&lt;/newTerm&gt;
  &lt;/NewTerms&gt;
  </code></pre>
  <p>and I just simply want to sort them alphabetically from a xsl sheet. The xsl that i have written (&amp; which is not working) is as followed:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;
  
    &lt;xsl:output method=&quot;xml&quot; indent=&quot;yes&quot; omit-xml-declaration=&quot;no&quot;/&gt;
  
    &lt;xsl:template match=&quot;NewTerms&quot;&gt;
  
        &lt;xsl:apply-templates&gt;
          &lt;xsl:sort select=&quot;newTerm&quot;/&gt;
        &lt;/xsl:apply-templates&gt;
  
    &lt;/xsl:template&gt;  
    
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>I am very sure that I haven't understood how xsl:sort function.</p>