Hi,<div><br></div><div>I&#39;m a newbie in XQuery and i appreciate a answer to this doubt.</div><div><br></div><div>I store several XML documents in a Native XML Database (eXist).</div><div>In my organisation i have several collections with several XML files that share the same structure. The following structure defines 2 collections A and B. The collection A have 2 XML files and the collection B one.&nbsp;</div>

<div><br></div><div>A</div><div>&nbsp;&nbsp;- 1.xml</div><div>&nbsp;&nbsp;- 2.xml</div><div>B</div><div>&nbsp;&nbsp;- 3.xml&nbsp;</div><div><br></div><div>I have his XQuery file:</div><div><br></div><div>FOR $x in collection(&quot;A&quot;,&quot;B&quot;)<br>
</div><div>WHERE ...</div><div>RETURN ?</div><div><br></div><div>If, for example, only the 2.xml and 3.xml were evaluate for TRUE in the WHERE clause, i want to obtain the following XML data:</div><div><br></div>
<div>&lt;RESULTS&gt;</div><div>&lt;A&gt;2.xml&lt;A&gt;</div><div>&lt;B&gt;3.xml&lt;/B&gt;</div><div>&lt;/RESULTS&gt;</div><div><br></div><div>What should i put in the RETURN clause?</div><div><br></div><div>I can also have collections inside other collections...</div>
<div><br></div><div>Thanks in advance</div><div><br></div><div><br></div><div><br clear="all"><br>-- <br>Ricardo Queirós<br>
</div>