File: Data.xml
29.99
10.00
69.99
39.99
3.99
File: Query.xquery
let $bargains := doc("Data.xml")/prices/priceList/prod[price < 30]
return if ($bargains)
then {$bargains}
else ()
Output:
29.99
10.00