Skip to content

XQuery

Use XQuery when you need more advanced XML querying or update behavior than a single XPath expression can provide.

XQuery builds on XPath. It is the better choice when you need to iterate over XML collections, reshape result sets, or apply update logic that would be awkward in a short XPath expression.

When to Use XQuery

  • querying XML databases with more than a simple path filter
  • returning transformed XML structures
  • iterating through collections with for and let
  • applying update-oriented logic through the XQuery update facility

Section Map

Prerequisite

Learn XPath first. Most XQuery statements embed XPath expressions directly.