XSL 1.0 doesn't have a way to do this, though many processors
have extensions that will do this for you. How and if you do
it depends on your processor. Consult the processor's
documentation. "Someone" who suggested using the document()
function doesn't understand that its purpose is to read
external XML files rather than to write them.
No, I think "someone" had come across the xsl:document instruction in the
now-defunct XSLT 1.1 working draft, which in XSLT 2.0 has been renamed
xsl:result-document.
Michael Kay