2.2.3 [XDM/2] Section 6.2.4, Element Nodes, Construction from a PSVI

C00003:

The specification states that the processor can use a sequence of nodes that are processing instruction nodes or comment nodes, in the children collection. XQuery in SQL Server supports processing instruction nodes or comment nodes in the collection of children nodes.

If an element has simple typed content and contains either processing instruction or comment nodes or both, XQuery in SQL Server moves all the processing instruction children nodes and all the comment children nodes to the front of the collection of children nodes, preserving order, and combines all the text children nodes into one typed text node value that follows the other children nodes.