While the XSLT 1.1 standard was never finalized, libxslt adopted some parts of it anyway, including the <xsl:document> instruction element, which later came to be known as <xsl:result-document> in XSLT 2.0. This element is used to output XML, HTML, or text to an output file.
Internal to libxslt (and therefore, to Junos OS), it shares code with four other extension elements:
<exsl:document>, <redirect:write>, <saxon:output>, and <xt:document>
Read more in Excerpt on the <xsl:document> Instruction Element