I have this difficult situation where I need to use the CDATA tags inside another CDATA tags. The situation is simple to explain though.
I have the following thing:<
You can escape ]]> substring in CDATA section by replacing it with:
]]>
]]]]><![CDATA[>
... line. With this you'll make ]] a part of one CDATA section, and > - of another, that starts right when the preceding one ends.
]]
>