title: XSLT - Copy all other nodes, add 1 new node
body: <p>I have created an XSLT and i was wondering how it is possible to copy all nodes between one set of tags, and add another tag at the bottom. I have created the XSLT that has all the logic for determining which tag to add, and what it should be called. However the issue i am now getting is that i can not copy all the other tags across too. Below are the files in question:</p>
  
  <p><strong>XSLT</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      version="1.0"&gt;
      &lt;xsl:output method="xml" indent="yes"/&gt;
  
      &lt;xsl:template match="@*|node()"&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select="@*|node()"/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
      &lt;xsl:template match="/csvImportSchema"&gt;
          &lt;csvImportSchema&gt;
              &lt;xsl:for-each select="payload"&gt;
                  &lt;payload&gt;
                      &lt;xsl:copy-of select="@*"/&gt;
                      &lt;xsl:variable name="ean"&gt;
                          &lt;xsl:value-of select="ean"/&gt;
                      &lt;/xsl:variable&gt;
                      &lt;xsl:for-each select="../product"&gt;
                          &lt;xsl:if test="ean = $ean"&gt;
                              &lt;productId&gt;&lt;xsl:value-of select="article"/&gt;&lt;/productId&gt;
                          &lt;/xsl:if&gt;
                      &lt;/xsl:for-each&gt;
                  &lt;/payload&gt;
              &lt;/xsl:for-each&gt;
          &lt;/csvImportSchema&gt;
      &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p><strong>INPUT</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;csvImportSchema&gt;
      &lt;payload&gt;
          &lt;test&gt;1&lt;/test&gt;
          &lt;test2&gt;2&lt;/test2&gt;
          &lt;test3&gt;3&lt;/test3&gt;
          &lt;ean&gt;1111111111&lt;/ean&gt;
          &lt;productId/&gt;
      &lt;/payload&gt;
      &lt;product&gt;
          &lt;article&gt;722619&lt;/article&gt;
          &lt;ean&gt;1111111111&lt;/ean&gt;
      &lt;/product&gt;
  &lt;/csvImportSchema&gt;
  </code></pre>
  
  <p><strong>CURRENT OUTPUT</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;csvImportSchema&gt;
      &lt;payload&gt;
          &lt;productId&gt;722619&lt;/productId&gt;
      &lt;/payload&gt;
  &lt;/csvImportSchema&gt;
  </code></pre>
  
  <p><strong>DESIRED OUTPUT</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;csvImportSchema&gt;
      &lt;payload&gt;
          &lt;test&gt;1&lt;/test&gt;
          &lt;test2&gt;2&lt;/test2&gt;
          &lt;test3&gt;3&lt;/test3&gt;
          &lt;ean&gt;1111111111&lt;/ean&gt;
          &lt;productId&gt;722619&lt;/productId&gt;
      &lt;/payload&gt;
  &lt;/csvImportSchema&gt;
  </code></pre>