In level 2, on document view import XML text is converted to the special node/property structure jcr:xmltext/jcr:xmlcharacters (see 7.3.2 Import from Document View). When this structure is mapped back to XML the following rules apply.
If a child node of N called jcr:xmltext is encountered and that jcr:xmltext node has one and only one child item and that item is a single-valued property called jcr:xmlcharacters, then the treatment of that jcr:xmltext depends on the context within which the document view is being used:
Export: In the context of export, the jcr:xmltext node is not converted into an XML element. Instead, the value of the jcr:xmlcharacters property becomes text within the body of the XML element N. Entity references are used to escape characters which should not be included as literals within XML text (see 6.4.4 Escaping of Values) however, escaping of whitespace is not performed (see 6.4.2.5 Multi-value Properties). Note also that two or more jcr:xmltext nodes adjacent within the ordering of a child node set will have the values of their respective jcr:xmlcharacters concatenated into a single resulting XML text node.
XPath: In the context of an XPath query jcr:xmltext nodes and jcr:xmlcharacters properties are treated just like any other nodes and properties, appearing as elements and attributes, respectively, within the virtual document view stream against which XPath queries are run. See 6.6.4.12 text() Node Test for more details.