XQuery is the query language for XML.
It provides a mechanism to extract and manipulate data from XML documents or any data source that can be viewed as XML such as relational databases or office documents.
Just as SQL is a query language that queries relational tables to create new relational tables, XQuery queries XML documents to create new XML documents.
XQuery uses XPath syntax to address specific parts of an XML document.