XQuery is a functional query language that is built on XPath expressions.
It is designed to query data stored in the form of XML. We can say that XQuery is to XML what SQL is to a database.
You should have a basic knowledge of:
for $x in doc("books.xml")/bookstore/book
order by $x/title