title: Transforming escaped XML text into CDATA sections
body: <p>I'm looking to replace escaped XML sections with CDATA blocks, mainly to improve the readability of XML that unfortunately has to be read by a human.</p>
  
  <pre><code>// Input
  def xml = '''
  &lt;search&gt;
    &lt;search-query&gt;
      &amp;lt;nested/&amp;lt;
      &amp;lt;xml/&amp;lt;
    &lt;/search-query&gt;
  &lt;/search&gt;
  '''
  
  def search = new XmlParser().parseText(xml)
  def query = search."search-query"
  query.replaceNode() {
    "search-query"() {
      // TODO how can I add a CDATA section here?
      //yieldUnescaped("&lt;![CDATA[${query.text()}]]&gt;")
    }
  }
  
  new XmlNodePrinter(preserveWhitespace:true).print(search)
  
  // Expected
  '''
  &lt;search&gt;
    &lt;search-query&gt;
      &lt;![CDATA[&lt;nested/&gt;
      &lt;xml/&gt;]]&gt;
    &lt;/search-query&gt;
  &lt;/search&gt;
  '''
  </code></pre>
  
  <ul>
  <li>Performance is not important</li>
  <li>I want to be able to use CDATA on only certain elements</li>
  </ul>