title: how to split xml root into two branches in the same file based on attribute value of child elements
body: <p>If I have this file</p>
  
  <pre><code>&lt;config someAttribute="sA" otherAttribute="oA"&gt;
  &lt;parameter name="p1" yetAnotherAttribute="yAA"&gt;
      Something
  &lt;/parameter&gt;
  &lt;parameter name="p2" yetAnotherAttribute="yAA2"&gt;
      Something else
  &lt;/parameter&gt;
  &lt;parameter name="p3" yetAnotherAttribute="yAA3"&gt;
      Something more
  &lt;/parameter&gt;
  &lt;parameter name="p4" yetAnotherAttribute="yAA4"&gt;
      Yet more 
  &lt;/parameter&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>And I want something like this</p>
  
  <pre><code>&lt;configs&gt;
  &lt;config someAttribute="sA" otherAttribute="oA"&gt;
      &lt;parameter name="p1" yetAnotherAttribute="yAA"&gt;
          Something
      &lt;/parameter&gt;
      &lt;parameter name="p2" yetAnotherAttribute="yAA2"&gt;
          Something else
      &lt;/parameter&gt;
  &lt;/config&gt;
  &lt;config someAttribute="sA" otherAttribute="oA"&gt;
      &lt;parameter name="p3" yetAnotherAttribute="yAA3"&gt;
          Something more
      &lt;/parameter&gt;
      &lt;parameter name="p4" yetAnotherAttribute="yAA4"&gt;
          Yet more 
      &lt;/parameter&gt;
  &lt;/config&gt;
  &lt;/configs&gt;
  </code></pre>
  
  <p>Could you please help me with xslt file? Could you also tell me where I can find some useful resouces for learning xslt (from basic to advanced topics, other than w3schools)?</p>
  
  <p>I have decided to provide more meaninful files</p>
  
  <p>I want to transform this file</p>
  
  <pre><code>&lt;config width="100" height="200"&gt;
  &lt;parameter name="account number" country="UK"&gt;
      12345678901234567890123456
  &lt;/parameter&gt;
  &lt;parameter name="client code" codeType="xa"&gt;
      UK0112
  &lt;/parameter&gt;
  &lt;parameter name="email-address" accepts="yes"&gt;
      john.sparrow@rex.co.uk
  &lt;/parameter&gt;
  &lt;parameter name="postal-code" country="UK"&gt;
      W1A 1HQ 
  &lt;/parameter&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Into this file</p>
  
  <pre><code>&lt;configs&gt;
  &lt;config width="100" height="200"&gt;
      &lt;parameter name="account number" country="UK"&gt;
          12345678901234567890123456
      &lt;/parameter&gt;
      &lt;parameter name="client code" codeType="xa"&gt;
          UK0112
      &lt;/parameter&gt;
  &lt;/config&gt;
  &lt;config width="100" height="200"&gt;
      &lt;parameter name="email-address" accepts="yes"&gt;
          john.sparrow@rex.co.uk
      &lt;/parameter&gt;
      &lt;parameter name="postal-code" country="UK"&gt;
          W1A 1HQ 
      &lt;/parameter&gt;    
  &lt;/config&gt;
  &lt;/configs&gt;
  </code></pre>
  
  <p>Kind regards,
  MY</p>