No distinction is made between a single item and a singleton sequence.
XQuery contains a superset of XPath expression syntax to address specific parts of an XML document.
It supplements this with a SQL-like "FLWOR expression" for performing joins.
A FLWOR expression is constructed from the five clauses after which it is named: FOR, LET, WHERE, ORDER BY, RETURN.
XQuery (XML Query) is a query and functional programming language that queries and transforms collections of structured and unstructured data, usually in the form of XML, text and with vendor-specific extensions for other data formats (JSON, binary, etc.).
The language is developed by the XML Query working group of the W3C.
The work is closely coordinated with the development of XSLT by the XSL Working Group; the two groups share responsibility for XPath, which is a subset of XQuery.
XQuery 1.0 became a W3C Recommendation on January 23, 2007.
"The mission of the XML Query project is to provide flexible query facilities to extract data from real and virtual documents on the World Wide Web, therefore finally providing the needed interaction between the Web world and the database world.
Ultimately, collections of XML files will be accessed like databases".
All XQuery expressions operate on sequences, and evaluate to sequences. Items can be either nodes, which represent components of XML documents, or atomic values, which are instances of XML Schema base types like .
Sequences can also be empty, or consist of a single item only.