def escape_cdata(cdata):
 return xml_safe(cdata).replace(']]>', ']]>]]&gt;<![CDATA[')

def escape_cdata ( cdata ) : return xml_safe ( cdata ) . replace ( ']]>' , ']]>]]&gt;<![CDATA[' )
escape a string for an xml cdata section .