def _MakeXMLSafe(s):
 s = cgi.escape(s)
 s = re.sub('[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]', '', s)
 s = s.encode('ascii', 'xmlcharrefreplace')
 return s

def _MakeXMLSafe ( s ) : s = cgi . escape ( s ) s = re . sub ( '[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]' , '' , s ) s = s . encode ( 'ascii' , 'xmlcharrefreplace' ) return s
escapes < .