I need to embed arbitrary (syntactically valid) XML documents within a wrapper XML document. The embedded documents are to be regarded as mere text, they do not need to be p
When you escape the ending angular bracket of the inner CDATA, most XML parsers will not complain about the well-formedness of your XML. Using this "workaround", you should be able to nest multiple CDATA sections.
Something like:
]]>
Note that the inner CDATA has its ending ">" escaped as >.