You asked for the best solution, and you said you didn't want to use XSLT. Well, the best solution is XSLT, whether you like it or not.
<xsl:template match="/">
<xsl:copy>
<xsl:copy-of select="*/node()"/>
<xsl:copy-of select="document('other.xml')/*/node()"/>
</xsl:copy>
</xsl:template>
Of course if you're dead set against XSLT and don't mind using a working-draft language you could also use XQuery:
element {node-name(doc('first.xml')/*)} {
doc('first.xml')/*/node(), doc('second.xml')/*/node()
}
The only other alternatives are (a) to write a couple of hundred lines of Java or similar using the DOM (or JDOM, etc), or (b) to do it at the source XML level with some kind of Perl hack: not recommended.
Michael Kay
Michael Kay
http://saxon.sf.net/