File: order.xml
0001
name 1
0002
name 2
0003
name 3
File: inventory.xml
File: Query.xquery
for $car in doc("inventory.xml")//car
let $name := doc("order.xml")//car[id = $car/@id]/name
return name="{$name}"
quan="{$car/@quantity}"/>