Creates a new document node.
Permitted parent elements: any XSLT element whose content model is sequence-constructor; any literal result element
Used to perform document-level validation. Requires Saxon-EE.
Determines what happens to any type annotations on element or attribute nodes. Requires Saxon-EE.
Notes on the Saxon implementation
This instruction should not be confused with the instruction of the same name in
the withdrawn XSLT 1.1 draft, (which is supported in Saxon 6.5.x). That
instruction was a precursor to
The content of the new document node is created using the contained instructions
(in the same way as xsl:result-document), and the new document node is added to the result
sequence. The instruction is useful mainly if you want to validate the document:
the element allows attributes
which perform document-level validation in the same way as the corresponding
The instruction also allows a function or template to create a temporary tree without the need to create a variable and then return the value of the variable.