File: Data.xml
0001
name 1
0002
name 2
0003
name 3
0004
name 4
File: Query.xquery
for $prod in doc("Data.xml")//car
let $prodmodel := $prod/@model
where $prod/id > 100
and starts-with($prod/name, "F")
and exists($prod/colorChoices)
and ($prodmodel = "B" or $prodmodel = "A")
return $prod