<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="xsl-elements" page="document" subpage=""/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: xsl:document</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: xsl:document"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>xsl:document</h1>
      <p>The <code>xsl:document</code> instruction creates a new document node. The content of the new document node
is created using the contained instructions (in the same way as <code>xsl:result-document</code>), 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 <code>validation</code> and <code>type</code> which perform
document-level validation in the same way as the corresponding attributes on <code>xsl:result-document</code>.</p>
      <p>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.</p>
      <p>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 <code>xsl:result-document</code>.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="element.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>