title: How to from groups from nodes without changing order?
body: <p>Let's say that we have some items which are either fruits or clothes:</p>
  
  <pre><code>&lt;items&gt;
      &lt;orange/&gt;
      &lt;banana/&gt;
      &lt;apple/&gt;
      &lt;jacket/&gt;
      &lt;shirt/&gt;
      &lt;trousers/&gt;
      &lt;apple/&gt;
      &lt;banana/&gt;
      &lt;jacket/&gt;
      &lt;apple/&gt;
      &lt;banana/&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>And I would like them to be grouped following way without changing order of items:</p>
  
  <pre><code>&lt;items&gt;
      &lt;fruits&gt;
          &lt;orange/&gt;
          &lt;banana/&gt;
          &lt;apple/&gt;
      &lt;/fruits&gt;
      &lt;clothes&gt;
          &lt;jacket/&gt;
          &lt;shirt/&gt;
          &lt;trousers/&gt;
      &lt;/clothes&gt;
      &lt;fruits&gt;
          &lt;apple/&gt;
          &lt;banana/&gt;
      &lt;/fruits&gt;
      &lt;clothes&gt;
          &lt;jacket/&gt;
      &lt;/clothes&gt;
      &lt;fruits&gt;
          &lt;apple/&gt;
          &lt;banana/&gt;
      &lt;/fruits&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I am complete beginner what comes to XSLT and after browsing through countless examples I still don't have a clue whatsoever how achieve that using XSLT.</p>