+11  A: 

You can do it like this:

]]>]]&gt;<![CDATA[

This ends up breaking the CDATA section in two parts, but it's what you have to do.

Greg Hewgill
Better answer IMHO than in the duplicate :)
Rory Becker
One word: Yikes.
Paolo Bergantino
Paolo: think of it that way: CDATA is an area where you don't have to (and in fact can't) escape *anything*. How would you mark the end of such an area?
Joachim Sauer
The length (in bytes) could be a required attribute. I absolutely agree with Paolo: Yikes.
Nikolai Ruhe
A: 
Joachim Sauer
+4  A: 

I think

<![CDATA[]]]]><![CDATA[>]]>

is the way to go.

See more at http://en.wikipedia.org/wiki/CDATA#Uses_of_CDATA_sections

Henrik Paul
I don't know if this is the right answer or not, but if so, it's the worst right answer ever. (No offence intended...I'm commenting on the miserableness of the system, rather than your answer.)
Beska
+1  A: 

The right angle bracket (>) […] must, for compatibility, be escaped using either " &gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.
http://www.w3.org/TR/REC-xml/#dt-chardata

Gumbo