title: Merge multiple XML files into one using PowerShell 2.0?
body: <p>I have a directory of very large XML files with a structure as this:</p>
  
  <p>file1.xml:</p>
  
  <pre><code>&lt;root&gt;
   &lt;EmployeeInfo attr="one" /&gt;
   &lt;EmployeeInfo attr="two" /&gt;
   &lt;EmployeeInfo attr="three" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>file2.xml:</p>
  
  <pre><code>&lt;root&gt;
   &lt;EmployeeInfo attr="four" /&gt;
   &lt;EmployeeInfo attr="five" /&gt;
   &lt;EmployeeInfo attr="six" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Now I am looking for a simple way to merge these files (*.xml) files into one output file:</p>
  
  <pre><code>&lt;root&gt;
   &lt;EmployeeInfo attr="one" /&gt;
   &lt;EmployeeInfo attr="two" /&gt;
   &lt;EmployeeInfo attr="three" /&gt;
   &lt;EmployeeInfo attr="four" /&gt;
   &lt;EmployeeInfo attr="five" /&gt;
   &lt;EmployeeInfo attr="six" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I was thinking about using pure XSLT such as this one:</p>
  
  <pre><code>&lt;xsl:transform version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:template match="/"&gt;
      &lt;Container&gt;
        &lt;xsl:copy-of select="document('file1.xml')"/&gt;
        &lt;xsl:copy-of select="document('file2.xml')"/&gt;        
      &lt;/Container&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This works but isn't as flexible as I want.  Being a novice with PowerShell (version 2) eager to learn new best pracctices of working with XML in PowerShell I am wondering what is the simplest, purest <em>PowerShell way</em> of merging the structre of XML documents into one? </p>
  
  <p>Cheers,
  Joakim</p>