title: Join multiple XML files with xinclude tags into single file
body: <p>I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using &lt;xinclude&gt; and &lt;xfragment&gt; tags. Unfortunately, IzPack does not combine them together when you build your installer. This requires you to package the files with the installer, which just won't work. </p>
  
  <p>I was about to start writing a tool in Java to load the XML files and combine them, but I don't want to go reinventing the wheel. </p>
  
  <p>Do the Java XML libraries provide native handling of xinclude? A google didn't seem to turn up much. </p>
  
  <p>Not a big deal if I have to write this myself, just wanted to check with you guys. Thanks.</p>
  
  <p>Format of XML for example purposes:
  File1.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?&gt;
  &lt;installation version="1.0"&gt;
  &lt;packs&gt;      
      &lt;pack name="Transaction Service" id="Transaction Service" required="no" &gt;
          &lt;xinclude href="example/File2.xml" /&gt;
      &lt;/pack&gt;
  &lt;/packs&gt;
  </code></pre>
  
  <p>File2.xml</p>
  
  <pre><code>&lt;xfragment&gt;
      &lt;file src="..." /&gt;
  &lt;/xfragment&gt;
  </code></pre>
  
  <p>File2 does not need the standard XML header. The xml file is parsed at build time, because the resources it specifies are included in the installer. What isn't included is the actual XML information (order to write the files, where to put them etc.)</p>
  
  <p>What I am looking to have produced:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?&gt;
  &lt;installation version="1.0"&gt;
  &lt;packs&gt;      
      &lt;pack name="Transaction Service" id="Transaction Service" required="no" &gt;
          &lt;file src="..." /&gt;
      &lt;/pack&gt;
  &lt;/packs&gt;
  </code></pre>
  
  <p>Thanks, I am going to start whipping it together in Java now, but hopefully someone has a simple answer. </p>
  
  <p>Tim Reynolds</p>