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,
$car in doc("Data.xml")//car[id = $car/@id]
return name="{$car/name}"
quan="{$car/@quantity}"/>