This version was hacked by mag to support CDATA tidying in XML files.
