File: Data.xml
1
name 1
navy black
2
name 2
3
name 3
File: Query.xquery
car order
{
for $prod in doc("Data.xml")/order/car
return - num: {data($prod/num)
}, name: {data($prod/name)}
}
Output:
car order
- num: 1, name: name 1
- num: 2, name: name 2
- num: 3, name: name 3