I need to grab the xhtml source from a site and store it in an xml file, however the xhtml contains CDATA and since nested CDATA is not allowed I'm not sure what to do. Is there any simple solution to this or is there some easy way to covert the xhtml to html? Thanks for any help.
Putting XML content in CDATA sections is generally a bad idea (it's an abuse of CDATA, for a start: by putting something in CDATA you are saying "there is no markup in here"). Nesting CDATA seems doubly bad. But you've got yourself into this hole, and you're determined to dig yourself in deeper, so you can do it if you try. Just replace the ]]>
that terminates a CDATA section with ]]]><![CDATA[[
.