Hi there,

I was looking on the Internet if there is a way to combine XML documents with XPath in Java. Ofcourse I can write it by myself but i can imagine there is also an XPath statement that will do that for you (much easier). I coudn't found it yet, but meaby some of you know if there is posibility to do that with XPath in Java.

In this situation I want to join element Number from XMLDOC 1 with element ID 10 from XMLDOC 2. Is there something like on SQL statement to do this.
SELECT doc1.*, doc2.* FROM XMLDOC1 as doc1 INNER JOIN XMLDOC2 as doc2 ON doc1.Number = doc2.ID.


Example:
---------------------XMLDOC1---------------------
   <RECORD>
      <Number>10</Number>
      <Title>Eats, Shoots &amp; Leaves</Title>
      <Author>Lynne Truss</Author>
      <ISBN13>978-1592400874</ISBN13>
      <Pages>209</Pages>
   </RECORD>
<RECORD>
      ..... ..................etc.
</RECORD>

---------------------XMLDOC2---------------------
   <RECORD>
      <ID>10</ID>
      <Name>Miranda</Name>
      <Date>06-04-2006</Date>
      <Age>47</Age>
   </RECORD>
<RECORD>
      ..... ..................etc.
</RECORD>


----COMBINED XMLDOC 1 and 2---------------

RECORD>
      <Number>10</Number>
      <Title>Eats, Shoots &amp; Leaves</Title>
      <Author>Lynne Truss</Author>
      <ISBN13>978-1592400874</ISBN13>
      <Pages>209</Pages>
      <Name>Miranda</Name>
      <Date>06-04-2006</Date>
      <Age>47</Age>
</RECORD>


If somebody know the answer thank you..