Preserve CDATA nodes when converting XML string into XMLElement

CDATA was getting identified as DOMText and therefore sanitised when it should be preserved as a CDATA section.
Fix indentation
Merge pull request #2208 from g-wilson/integration

Preserve CDATA nodes when converting XML string into XMLElement