def wash_for_xml(text, xml_version='<STR_LIT:1.0>'):
if xml_version == '<STR_LIT:1.0>':<EOL><INDENT>return RE_ALLOWED_XML_1_0_CHARS.sub(<EOL>'<STR_LIT>', unicode(text, '<STR_LIT:utf-8>')).encode('<STR_LIT:utf-8>')<EOL><DEDENT>else:<EOL><INDENT>return RE_ALLOWED_XML_1_1_CHARS.sub(<EOL>'<STR_LIT>', unicode(text, '<STR_LIT:utf-8>')).encode('<STR_LIT:utf-8>')<EOL><DEDENT>
Remove any character which isn't a allowed characters for XML.

    The allowed characters depends on the version
    of XML.

        - XML 1.0:
            <http://www.w3.org/TR/REC-xml/#charsets>
        - XML 1.1:
            <http://www.w3.org/TR/xml11/#charsets>

    :param text: input string to wash.
    :param xml_version: version of the XML for which we wash the
        input. Value for this parameter can be '1.0' or '1.1'