title: Dynamically include XML files using XSLT
body: <p>I am trying to merge multiple XML files into one in the following manner:</p>
  
  <p>Say I have an XML file, called <code>fruit.xml</code>:</p>
  
  <pre><code>&lt;fruit&gt;
      &lt;apples&gt;
          &lt;include ref="apples.xml" /&gt;
      &lt;/apples&gt;
      &lt;bananas&gt;
          &lt;include ref="bananas.xml" /&gt;
      &lt;/bananas&gt;
      &lt;oranges&gt;
          &lt;include ref="oranges.xml" /&gt;
      &lt;/oranges&gt;
  &lt;/fruit&gt;
  </code></pre>
  
  <p>and subsequent XML files that are referenced from <code>fruit.xml</code>, like for example <code>apples.xml</code>:</p>
  
  <pre><code>&lt;fruit&gt;
      &lt;apples&gt;
          &lt;apple type="jonagold" color="red" /&gt;
          &lt;... /&gt;
      &lt;/apples&gt;
  &lt;/fruit&gt;
  </code></pre>
  
  <p>and so on... I would like to merge these into 1 XML file, like such:</p>
  
  <pre><code>&lt;fruit&gt;
      &lt;apples&gt;
          &lt;apple type="jonagold" color="red" /&gt;
          &lt;... /&gt;
      &lt;/apples&gt;
      &lt;bananas&gt;
          &lt;banana type="chiquita" color="yellow" /&gt;
          &lt;... /&gt;
      &lt;/bananas&gt;
      &lt;oranges&gt;
          &lt;orange type="some-orange-type" color="orange" /&gt;
          &lt;... /&gt;
      &lt;/oranges&gt;
  &lt;/fruit&gt;
  </code></pre>
  
  <p>I want to determine the "child" files (like <code>apples.xml</code>, <code>bananas.xml</code>, etc.) dynamically based on the values of the <code>ref</code> attributes in the <code>&lt;include&gt;</code> elements of <code>fruits.xml</code> and then include them in the output.</p>
  
  <p><strong>Is this possible using XSLT?</strong></p>