I finally found some Xalan multiple output document stuff. The source code is:
org.apache.xalan.lib.Redirect.java.
There's also some docs for it. It outputs to a file instead of a String, but
you might be able to either subclass it or
use some of its code for what you want. I also found that an abandoned W3C
XSLT1.1 spec had a multiple output document
sketch. Couldn't find any XSLT2 drafts or Xalan plans for XSLT2. You're
basically running into one of the wants for
XSLT2.
For what you're doing it would be nice to have an extension element or function
that serializes a RTF. Something like:
<xsl:variable name="body>
<ext:serialize method="html" ...>
<xsl:apply-templates/>
</ext:serialize>
</xsl:variable>
Or even just as ext:serializeHTML($rtf).
What ext:serialize would do is evaluate its content as a template with the
current context and variable bindings and
turn it into a single text node subject to output formatting similar to the
xsl:output tag.