title: XML/XSLT putting subnode elements to upper level
body: <p>I've been looking for solutions to fix a problem that I have with my xml file. I want to edit it using xslt. I'm looking to put the elements contained in  to the upper node, so they will be at the same level that "id" and "date".</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;test&gt;
  - &lt;invoice&gt;
    &lt;id&gt;163-01&lt;/id&gt;
    &lt;date&gt;2016-09-06&lt;/date&gt;
      - &lt;order&gt;
        &lt;cadreLegal&gt;LAB&lt;/cadreLegal&gt;
        &lt;prestataire&gt;907&lt;/prestataire&gt;
        &lt;personneProtegee&gt;1951&lt;/personneProtegee&gt;
        &lt;dateEtablissement&gt;2016-09-06&lt;/dateEtablissement&gt;
        &lt;heureEtablissement&gt;13:22:00&lt;/heureEtablissement&gt;
        &lt;/order&gt;
   &lt;/invoice&gt;
  - &lt;invoice&gt;
    &lt;id&gt;163-01&lt;/id&gt;
    &lt;date&gt;2016-09-06&lt;/date&gt;
      - &lt;order&gt;
        &lt;cadreLegal&gt;LAB&lt;/cadreLegal&gt;
        &lt;prestataire&gt;907&lt;/prestataire&gt;
        &lt;personneProtegee&gt;1951&lt;/personneProtegee&gt;
        &lt;dateEtablissement&gt;2016-09-06&lt;/dateEtablissement&gt;
        &lt;heureEtablissement&gt;13:22:00&lt;/heureEtablissement&gt;
        &lt;/order&gt;
   &lt;/invoice&gt;
    &lt;/test&gt;
   </code></pre>
  </div>
  </div>
  </p>
  
  <p>This what I want to have.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;test&gt;
  - &lt;invoice&gt;
     &lt;id&gt;163-01&lt;/id&gt;
     &lt;date&gt;2016-09-06&lt;/date&gt;
     &lt;cadreLegal&gt;LAB&lt;/cadreLegal&gt;
     &lt;prestataire&gt;907&lt;/prestataire&gt;
     &lt;personneProtegee&gt;1951&lt;/personneProtegee&gt;
     &lt;dateEtablissement&gt;2016-09-06&lt;/dateEtablissement&gt;
     &lt;heureEtablissement&gt;13:22:00&lt;/heureEtablissement&gt; 
   &lt;/invoice&gt;
  - &lt;invoice&gt;
     &lt;id&gt;163-01&lt;/id&gt;
     &lt;date&gt;2016-09-06&lt;/date&gt;
     &lt;cadreLegal&gt;LAB&lt;/cadreLegal&gt;
     &lt;prestataire&gt;907&lt;/prestataire&gt;
     &lt;personneProtegee&gt;1951&lt;/personneProtegee&gt;
     &lt;dateEtablissement&gt;2016-09-06&lt;/dateEtablissement&gt;
     &lt;heureEtablissement&gt;13:22:00&lt;/heureEtablissement&gt;
   &lt;/invoice&gt;
  &lt;/test&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried several code using xslt but I never been able to get what I want. I also tried the solutions found on stackoverflow. Could you please help me fixing this issue?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
   &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
   &lt;xsl:strip-space elements="*"/&gt;
  
   &lt;xsl:template match="node()|@*" name="order"&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select="node()|@*"/&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  
   &lt;xsl:template match="invoice"&gt;
    &lt;xsl:copy-of select="/*/order"/&gt;
    &lt;xsl:call-template name="test"/&gt;
   &lt;/xsl:template&gt;
  
   &lt;/xsl:stylesheet&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank you in advance .</p>
  
  <p>Rflow</p>