title: Copy xml document's images in different source locations into single output directory
body: <p>I am having a xml document with uses xinclude for access several other xml files.</p>
  
  <pre><code>&lt;chapter xml:id="chapter1"&gt;
  &lt;title&gt;Chapter in Main Doc&lt;/title&gt;
  &lt;section xml:id="section"&gt;
      &lt;title&gt;Section in Main Doc 1&lt;/title&gt;
              &lt;mediaobject&gt;
                  &lt;imageobject&gt;
                      &lt;imagedata fileref="images/car.jpg"/&gt;
                  &lt;/imageobject&gt;
              &lt;/mediaobject&gt;
  &lt;/section&gt;
  &lt;xi:include href="../some-doc/section1.xml"/&gt;
  &lt;xi:include href="../some-doc/section2.xml"/&gt;
  </code></pre>
  
  <p>
  These other section1 and section2 xml files uses different images in different source locations. I need to copy those all images to single output directory. There fore at first, I am planning to use XSLT to parse entire xml documents and generate a list of images to be copied. How can I generate that list of images of xml files using XSLT? Your ideas really appreciated. </p>
  
  <p>Thanks in advance..!!</p>
  
  <p><strong>Added:</strong></p>
  
  <p>I tried with below answered XSLT 1.0 code. When I generate html output using it, it only displays chapter and section ids like "chapter1, section ...". It does not display image path value inside imagedata node.</p>
  
  <p>But when I changed <code>&lt;xsl:template match="@*|node()"&gt;</code> as <code>&lt;xsl:template match="*"&gt;</code> then it displays all image path values of xincluded xml files also. But there are other node's values like above also. I need to filter all values other than image paths.  </p>
  
  <p>Here I need to copy only image paths of all xml documents and keep those all paths in a array or some thing like it. Then I can use those saved image paths for image coping purpose using a java class.</p>