def xhtml_escape(value):
 return _XHTML_ESCAPE_RE.sub((lambda match: _XHTML_ESCAPE_DICT[match.group(0)]), to_basestring(value))

def xhtml_escape ( value ) : return _XHTML_ESCAPE_RE . sub ( ( lambda match : _XHTML_ESCAPE_DICT [ match . group ( 0 ) ] ) , to_basestring ( value ) )
escapes a string so it is valid within html or xml .