Elements that contain data of type xs:string may need to be escaped to prevent the xml parser from getting confused. How best to do this depends on the encoding of the string.
ASCII
If the string is guaranteed to only contain characters from the ASCII character set then it needs to be escaped only if it contains the characters <, & or > (> is normally OK except under confusing circumstances so it's probably best to escape it anyway). A CDATA declaration has the form:
<![CDATA[some_string_goes_here]]>
This will escape any ASCII string except for ones that contain the substring ]]> since this would otherwise be the close delimiter. To escape such strings one can perform a global search and replace:
s/]]>/]]]]><