To insert two XML fragments in a page, you include two XMLTransform servlet beans that are adjacent and equal in the page hierarchy:

<dsp:droplet name="/atg/dynamo/droplet/xml/XMLTransform">
  <dsp:param name="input"    value="test-page.xml"/>
  <dsp:param name="template" value="../../doc.xsl"/>
  <dsp:oparam name="failure">
    <HTML>
      <HEAD>
        <TITLE>XML/XSL Error</TITLE>
      </HEAD>
      <BODY>
        <H1>XML/XSL Error processing <dsp:valueof param="input"></dsp:valueof>
        </H1>
      </BODY>
    </HTML>
  </dsp:oparam>
</dsp:droplet>

<dsp:droplet name="/atg/dynamo/droplet/xml/XMLTransform">
  <dsp:param name="input"  param="document"/>
  <dsp:param name="template"   value="../xhtml-xinclude.xsl"/>
  <dsp:param name="passParams" value="query"/>
  <dsp:oparam name="failure">
    <HTML>
      <HEAD>
        <TITLE>XML/XSL Error</TITLE>
      </HEAD>
      <BODY>
        <H1>XML/XSL Error processing <dsp:valueof param="input"></dsp:valueof>
        </H1>
      </BODY>
    </HTML>
  </dsp:oparam>
</dsp:droplet>

Both servlet beans might be provided with their own encoding/ MIME type pair from their respective stylesheets. When the servlet beans are processed, each servlet bean uses its own encoding and MIME type pair to translate its content, but the pair used by the second XMLTranform are current at the end of the page so they are written to the HTTP header. This can cause an error if the content of the first XMLTransform is incompatible with the encoding enforced by the second XMLTransform. If encoding and MIME type are not set explicitly in the JSP, the settings provided by the second XMLTransform are applied to the entire page.