def xml_compare(a, b):
if not isinstance(a, six.string_types):<EOL><INDENT>a = ET.tostring(a, encoding='<STR_LIT:utf-8>').decode('<STR_LIT:utf-8>')<EOL><DEDENT>if not isinstance(b, six.string_types):<EOL><INDENT>b = ET.tostring(b, encoding='<STR_LIT:utf-8>').decode('<STR_LIT:utf-8>')<EOL><DEDENT>a = normalise_dict(xmltodict.parse(a))<EOL>b = normalise_dict(xmltodict.parse(b))<EOL>return a == b<EOL>
Compares two XML documents (as string or etree)

    Does not care about element order
    :param a: xml to compare
    :param b: xml to compare