title: Groovys XmlParser ignores CDATA CR/CL
body: <p>I want to parse a log4j generated xml log. Within the xml is a node with a throwable (if any). This (multiline, tabbed) text is encapsulated in a CDATA tag.</p>
  
  <p>This is an excerpt of the whole file:</p>
  
  <pre><code>&lt;log4j:event logger="org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver" timestamp="1330083921521" level="ERROR" thread="http-8080-1"&gt;
  &lt;log4j:message&gt;&lt;![CDATA[Exception occurred when processing request: [GET] /test/log/show
  Stacktrace follows:]]&gt;&lt;/log4j:message&gt;
  &lt;log4j:throwable&gt;&lt;![CDATA[org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
      at test.LogController$_closure2.doCall(LogController.groovy:21)
      at test.LogController$_closure2.doCall(LogController.groovy)
      at java.lang.Thread.run(Thread.java:662)
  ]]&gt;&lt;/log4j:throwable&gt;
  &lt;/log4j:event&gt;
  </code></pre>
  
  <p>I parse it with groovys XmlParser:</p>
  
  <pre><code>def parser = new XmlParser(false, false).parse(new File("stack.log"))
  
  return parser.'log4j:event'.collect { l -&gt;
      LogEntry entry = new LogEntry()
      entry.with {
          level = l.'@level'
          message = l.'log4j:message'.text()
          thread = l.'@thread'
          logger = l.'@logger'
          timestamp = new Date(l.'@timestamp' as long)
          throwable = l.'log4j:throwable'?.text() ?: ''
      }
      entry
  }
  </code></pre>
  
  <p>The 'throwable' field contains all the text but without CR/LF.</p>
  
  <p>Does anybody know how to cope with that?</p>
  
  <p>Thanks in advcance...</p>