Combine two for loops and union results in XQuery
问题 Let's say we have this folders not_my_files collections collection1.xml collection2.xml collection3.xml etc... my_files my_documents mydoc1.xml mydoc2.xml mydoc3.xml etc... There are the structure of xml files collection1.xml (same structure for collection2.xml, collection3.xml, etc...) <collection xml:id="name_of_collection_1"> <ref id="id_of_ref_1"> <title>This is title 1 of first document in this collection</title> </ref> <ref id="id_of_ref_2"> <title>This is title 2 of second document in