title: Move/Copy node to multiple child nodes with XSLT
body: <p>I'm completely new to XSLT and need some help to solve one of my issues. What I want to accomplish is this:</p>
  
  <p>I have a file looking something like this:</p>
  
  <pre><code>&lt;Transaction&gt;
      &lt;Date&gt;2010-10-14T12:06:12.164+01:00&lt;/Date&gt;
      &lt;Production&gt;NO&lt;/Production&gt;
      &lt;Document fun:OID="1.9.101106"&gt;
          &lt;DocumentType xmlns=""&gt;Monthly A&lt;/DocumentType&gt;
          &lt;RangeName xmlns=""&gt;Range Name&lt;/RangeName&gt;
          &lt;Name xmlns=""&gt;Equity&lt;/Name&gt;
          &lt;Language xmlns=""&gt;English&lt;/Language&gt;
          &lt;Class xmlns=""&gt;A Acc&lt;/Class&gt;
          &lt;Active xmlns=""&gt;YES&lt;/Active&gt;
          &lt;Country xmlns=""&gt;UK&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Luxembourg&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Denmark&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Malta&lt;/Country&gt;
          &lt;Primary fun1:OID="1.9.101106" xmlns="" xmlns:fun1="DocumentXML.com"&gt;
                &lt;Name&gt;SISF-Indian-Equity-A-Acc-FMR-UKEN&lt;/Name&gt;
                &lt;FileSizeInKB&gt;176784&lt;/FileSizeInKB&gt;
                &lt;FileType&gt;pdf&lt;/FileType&gt;
                &lt;ReportingPeriod&gt;September&lt;/ReportingPeriod&gt;
                &lt;ReportingYear&gt;2010&lt;/ReportingYear&gt;
          &lt;/Primary&gt;
          &lt;Primary fun1:OID="1.9.101118" xmlns="" xmlns:fun1="DocumentXML.com"&gt;
                &lt;Name&gt;SISF-Indian-Equity-A-Acc&lt;/Name&gt;
                &lt;FileSizeInKB&gt;176784&lt;/FileSizeInKB&gt;
                &lt;FileType&gt;pdf&lt;/FileType&gt;
                &lt;ReportingPeriod&gt;September&lt;/ReportingPeriod&gt;
                &lt;ReportingYear&gt;2010&lt;/ReportingYear&gt;
          &lt;/Primary&gt;
      &lt;/Document&gt;
  &lt;/Transaction&gt;
  </code></pre>
  
  <p>And I want to keep the current file, except that I want to copy the country nodes in to be in the Primary node. So it would look something like this:</p>
  
  <pre><code>&lt;Transaction&gt;
      &lt;Date&gt;2010-10-14T12:06:12.164+01:00&lt;/Date&gt;
      &lt;Production&gt;NO&lt;/Production&gt;
      &lt;Document fun:OID="1.9.101106"&gt;
          &lt;DocumentType xmlns=""&gt;Monthly A&lt;/DocumentType&gt;
          &lt;RangeName xmlns=""&gt;Range Name&lt;/RangeName&gt;
          &lt;Name xmlns=""&gt;Equity&lt;/Name&gt;
          &lt;Language xmlns=""&gt;English&lt;/Language&gt;
          &lt;Class xmlns=""&gt;A Acc&lt;/Class&gt;
          &lt;Active xmlns=""&gt;YES&lt;/Active&gt;
          &lt;Country xmlns=""&gt;UK&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Luxembourg&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Denmark&lt;/Country&gt;
          &lt;Country xmlns=""&gt;Malta&lt;/Country&gt;
          &lt;Primary fun1:OID="1.9.101106" xmlns="" xmlns:fun1="DocumentXML.com"&gt;
                &lt;Name&gt;SISF-Indian-Equity-A-Acc-FMR-UKEN&lt;/Name&gt;
                &lt;FileSizeInKB&gt;176784&lt;/FileSizeInKB&gt;
                &lt;FileType&gt;pdf&lt;/FileType&gt;
                &lt;ReportingPeriod&gt;September&lt;/ReportingPeriod&gt;
                &lt;ReportingYear&gt;2010&lt;/ReportingYear&gt;
                &lt;Country xmlns=""&gt;UK&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Luxembourg&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Denmark&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Malta&lt;/Country&gt;
          &lt;/Primary&gt;
          &lt;Primary fun1:OID="1.9.101118" xmlns="" xmlns:fun1="DocumentXML.com"&gt;
                &lt;Name&gt;SISF-Indian-Equity-A-Acc&lt;/Name&gt;
                &lt;FileSizeInKB&gt;176784&lt;/FileSizeInKB&gt;
                &lt;FileType&gt;pdf&lt;/FileType&gt;
                &lt;ReportingPeriod&gt;September&lt;/ReportingPeriod&gt;
                &lt;ReportingYear&gt;2010&lt;/ReportingYear&gt;
                &lt;Country xmlns=""&gt;UK&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Luxembourg&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Denmark&lt;/Country&gt;
                &lt;Country xmlns=""&gt;Malta&lt;/Country&gt;
          &lt;/Primary&gt;
      &lt;/Document&gt;
  &lt;/Transaction&gt;
  </code></pre>
  
  <p>What would the best approach be to accomplish that? Do I need to do a copy of the whole document first and then copy the individual countries, or can I do this in one go somehow? </p>