File: Data.xml
0001
name 1
0002
name 2
0003
name 3
File: Query.xquery
{
for $a in doc("Data.xml")/order/car[1]
for $b in doc("Data.xml")/order/car[2]
return concat($a, " ", $b)
}
Output:
0001
name 1
0002
name 2