title: XSLT templates: change the order of processing nodes from source
body: <p>I am learning XSLT and how to use templates. </p>
  
  <p>I have the following (simplified) input:</p>
  
  <pre><code>&lt;root&gt;
      &lt;parent1 num="123" /&gt;
      &lt;parent2 type="ABC"&gt;
          &lt;child1&gt;702&lt;/child1&gt;
      &lt;/parent2&gt;    
  &lt;/root&gt;
  </code></pre>
  
  <p>I would like to use a template to transform this to:</p>
  
  <pre><code>&lt;item&gt;
      &lt;childentry&gt;702&lt;/childentry&gt;
      &lt;parententry&gt;ABC&lt;/parententry&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p>with the help of a template.</p>
  
  <p>And more as a general question: how can you change the order of processing nodes from source by using templates.</p>
  
  <p>Suggestions are really appreciated.</p>