title: How to convert a Node object to an XML String without escaping CDATA nodes value?
body: <p>I'm using groovy.util.Node to manipulate tree structures and than I store the trees in XML format.</p>
  
  <p>Some node value need to not be escaped.</p>
  
  <p>Code to create a tree:</p>
  
  <pre><code>def nodeValue = '&lt;![CDATA[you&amp;me]]&gt;'
  Node rootNode = new Node(null, 'parent', [:], nodeValue)
  rootNode.append(new Node(null, 'child', [:], nodeValue))
  </code></pre>
  
  <p>I've tried with  XmlUtil.serialize</p>
  
  <pre><code>println groovy.xml.XmlUtil.serialize(rootNode) // &amp; escaped to &amp;amp;
  </code></pre>
  
  <p>Here's the output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;parent&gt;&amp;lt;![CDATA[you&amp;amp;me]]&amp;gt;  &lt;child&gt;&amp;lt;![CDATA[you&amp;amp;me]]&amp;gt;&lt;/child&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>And with XmlNodePrinter:</p>
  
  <pre><code>def sw = new StringWriter()
  new (new IndentPrinter(sw, '', false)).print(rootNode)
  println sw.toString()  // &amp; escaped to &amp;amp;
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>&lt;parent&gt;&amp;lt;![CDATA[you&amp;amp;me]]&amp;gt;&lt;child&gt;&amp;lt;![CDATA[you&amp;amp;me]]&amp;gt;&lt;/child&gt;&lt;/parent&gt;
  </code></pre>
  
  <p>Someone has a groovy solution for avoid CDATA escaping ?</p>
  
  <p>Thanks,</p>