File: Data.xml 0001 name 1 0002 name 2 0003 name 3 File: Query.xquerylet $count := count(doc("Data.xml")//car)return {comment{concat(" List of ", $count, " cars ")}} Output: