parameters: (value, attr=False)
return_statement: return _xml_escape_re.sub(replace, value)
docstring: Escape a string for inclusion in XML.
docstring_summary: Escape a string for inclusion in XML.
docstring_tokens: Escape a string for inclusion in XML .
function: def _XmlEscape(value, attr=False):
    """ Escape a string for inclusion in XML."""
    def replace(match):
      m = match.string[match.start() : match.end()]
      # don't replace single quotes in attrs
      if attr and m == "'":
        return m
      return _xml_escape_map[m]
    return _xml_escape_re.sub(replace, value)
function_tokens: def _XmlEscape ( value , attr = False ) : def replace ( match ) : m = match . string [ match . start ( ) : match . end ( ) ] # don't replace single quotes in attrs if attr and m == "'" : return m return _xml_escape_map [ m ] return _xml_escape_re . sub ( replace , value )