File: Data.xml
0001
name 1
0002
name 2
0003
name 3
0004
name 4
File: Query.xquery
let $doc := doc("Data.xml")
for $prod in $doc//car
let $prodmodel := $prod/@model
let $prodName := $prod/name
where $prodmodel = "B" or $prodmodel = "A"
return $prodName
Output:
name 1
name 2
name 3