File: Data.xml
0001
name 1
0002
name 2
0003
name 3
0004
name 4
File: Query.xquery
let $count := 0
for $prod in doc("Data.xml")//car[@model = ("B", "A")]
let $count := $count + 1
return {$count}. {data($prod/name)}
Output:
1. name 1
1. name 2
1. name 3