What is XQuery For?

XQuery was devised primarily as a query language for data stored in XML form. So its main role is to get information out of XML databases - this includes relational databases that store XML data, or that present an XML view of the data they hold.

Some people are also using XQuery for manipulating free-standing XML documents, for example, for transforming messages passing between applications. In that role XQuery competes directly with XSLT, and which language you choose is largely a matter of personal preference.

In fact, some people like XQuery so much that they are even using it for rendering XML into HTML for presentation. That's not really the job XQuery was designed for, and there are other technologies, like XSLT, that are better suited for this purpose, but once you get to know a tool, you tend to find new ways of using it.

 
Free Stylus Studio XML Training:
W3C Member