Remove scripts, comments and cdata sections to avoid problems in the DOMDocument