title: xsl:output using cdata-section-elements, does not encapsulate the targeted cdata-section-element in CDATA tag
body: <p>I am trying:</p>
  
  <pre><code>            &lt;!-- Arrive at the target XQuery --&gt;
      &lt;p:processor name="oxf:xslt"&gt;
          &lt;p:input name="config"&gt;
              &lt;xsl:stylesheet version="2.0"&gt;
                  &lt;xsl:output method="xml" version="1.0"
  encoding="iso-8859-1" indent="yes" cdata-section-elements="text"/&gt;
                  &lt;xsl:template match="/"&gt;
                      &lt;xsl:variable name="apps" select="doc('input:instance')//APPLICATION"/&gt;                         
                      &lt;jaxrx:query&gt;
                          &lt;text&gt;
  xquery version "1.0";
  
  declare namespace fn="http://www.w3.org/2005/xpath-functions";
  
  let $dataSet := &lt;xsl:value-of select="doc('input:request')/request/parameters/parameter[name='dataSet']/value" /&gt;
  let $databaseName := &lt;xsl:value-of select="/Configuration/XMLDB/Name/text()" /&gt;
  let $applicationID := &lt;xsl:value-of select="doc('input:request')/request/parameters/parameter[name='applicationID']/value" /&gt;
  
  let $finalURL := fn:concat($databaseName, "/",$dataSet)
  let $applicationsModified := '&lt;xsl:copy-of select="$apps"/&gt;'
                              &lt;!-- disable-output-escaping not supported by Orbeon xslt processor
  (: let $applicationsModified := '&lt;xsl:text disable-output-escaping="yes"&gt;
                                  &lt;![CDATA[&lt;]]&gt;
                              &lt;/xsl:text&gt;
                              &lt;xsl:text disable-output-escaping="yes"&gt;![CDATA[&lt;/xsl:text&gt;
                              &lt;xsl:copy-of select="$apps"/&gt;
                              &lt;xsl:text&gt;]]&lt;/xsl:text&gt;
                              &lt;xsl:text disable-output-escaping="yes"&gt;
                                  &lt;![CDATA[&gt;]]&gt;&lt;/xsl:text&gt;' :) --&gt;
  for $all in fn:collection($finalURL)
      for $anApp in $all/APPLICATION[APPLICATION_ID=$applicationID]
  return 
  (
  replace node $anApp with $applicationsModified
  )
                          &lt;/text&gt;
                      &lt;/jaxrx:query&gt;
                  &lt;/xsl:template&gt;
              &lt;/xsl:stylesheet&gt;
          &lt;/p:input&gt;
          &lt;p:input name="data" href="#configuration"/&gt;
          &lt;p:input name="request" href="#request"/&gt;
          &lt;p:input name="instance" href="#instance"/&gt;
          &lt;p:output name="data" id="TargetXQuery"/&gt;
      &lt;/p:processor&gt;
  </code></pre>
  
  <p>With the hope of producing a result like </p>
  
  <pre><code>&lt;jaxrx:query&gt;&lt;text&gt;&lt;![CDATA[text of xquery with embedded xml]]&gt;&lt;/text&gt;&lt;/jaxrx:query&gt;
  </code></pre>
  
  <p>But the text (name of element) element's textual content does not get encapsulated in a CDATA section.  Any pointers why?</p>
  
  <p>I have also tried setting cdata-section-elements="jaxrx:text" instead of cdata-section-elements="text", but I still get</p>
  
  <pre><code>&lt;text&gt;text of xquery with embedded xml&lt;/text&gt;
  </code></pre>
  
  <p>, so no encapsulation in a CDATA section...</p>