Product SiteDocumentation Site

10.2. Changes to sequence normalization

The XQuery and XSLT serialization specification performs sequence normalization before serializing an XDM instance. The result is a sequence of exactly one document node.
JSONiq extends sequence normalization as follows:
The final step of building a document node with all items as its children is only done for adjacent XML nodes. JSON objects and arrays in the input sequence are left untouched.
This means that the final result of sequence normalization will be a sequence of objects, arrays and document nodes.