XQuery is a specification for a query language that allows a user or programmer to extract information from an Extensible Markup Language (XML) file or any collection of data that can be XML-like. The syntax is intended to be easy to understand and use. Using XQuery, it is possible to view a relational database table as an XML document. XQuery is an evolving specification under development by the World Wide Web Consortium (W3C) and has broad support from several major vendors including IBM, Microsoft, and Oracle.
XQuery makes use of XPath, a language that describes a way to locate and process items in XML documents. The specifications of XPath and XQuery are closely related. XQuery 1.0 derives directly from XPath 2.0. In XQuery, XPath expressions can be simple queries or parts of larger queries. XQuery has functions for numerous operations including date and time comparisons, mathematical calculations, string manipulations, and Boolean algebra. If a particular function is needed and is not found in XQuery, the programmer can write one.