We have a lot of separate files and want to put them together into one.
Step 1: Create a list of all filenames as XML file
<files>
<file>file1.xml</file>
<file>file2.xml</file>
<file>file3.xml</file>
</files>
Step 2: Create an XSL transform
<xsl:template match="//files">
<Root>
<xsl:for-each select="file">
<xsl:copy-of select="document(.)"/>
</xsl:for-each>
</Root>
</xsl:template>
Note the use of “copy-of” – it will copy all the nodes and attributes from the source XML.