XQuery - Overview


What is XQuery

XQuery is a functional language that is used to retrieve information stored in XML format. XQuery can be used on XML documents, relational databases containing data in XML formats, or XML Databases. XQuery 3.0 is a W3C recommendation from April 8, 2014.

The definition of XQuery as given by its official documentation is as follows −

XQuery is a standardized language for combining documents, databases, Web pages and almost anything else. It is very widely implemented. It is powerful and easy to learn. XQuery is replacing proprietary middleware languages and Web Application development languages. XQuery is replacing complex Java or C++ programs with a few lines of code. XQuery is simpler to work with and easier to maintain than many other alternatives.


  • Functional Language − XQuery is a language to retrieve/querying XML based data.

  • Analogous to SQL − XQuery is to XML what SQL is to databases.

  • XPath based − XQuery uses XPath expressions to navigate through XML documents.

  • Universally accepted − XQuery is supported by all major databases.

  • W3C Standard − XQuery is a W3C standard.

Benefits of XQuery

  • Using XQuery, both hierarchical and tabular data can be retrieved.

  • XQuery can be used to query tree and graphical structures.

  • XQuery can be directly used to query webpages.

  • XQuery can be directly used to build webpages.

  • XQuery can be used to transform xml documents.

  • XQuery is ideal for XML-based databases and object-based databases. Object databases are much more flexible and powerful than purely tabular databases.