>Home>Learn XQuery>XQuery Tutorial>XQuery Introduction>XQuery in a Nutshell
XQuery in a Nutshell
XQuery is not only a query language, but also a language that can do fairly general processing of XML. It is a strongly typed language that works well with data that may be strongly or weakly typed. Because the types used in XQuery are the same types used in XML and XML Schema, the type system is a better match for the data that is being processed. If the XML is governed only by a DTD or has no schema, the appropriate types are document, element, attribute, node, text node, processing instruction, comment, ID, IDREF, IDREFS, and so on. A strongly typed language that does not support these types tends to get in the way, because it is a poor match for the data being processed, and the language insists on the wrong things. If W3C XML Schema types are present in the data, these types are observed as well. Implementations and users of XQuery can work at various levels of typing by deciding whether to import schemas, whether to use static typing, and whether to set the validation mode to strict, lax, or skip.
XQuery was designed to be compact and compositional, and to be well suited for views of data that is not physically stored as XML. Both data integration and general purpose XML processing are likely to be important applications of XQuery. In practice, queries written in XQuery tend to be well suited to the kinds of tasks for which XML is generally used.