def compare_xml(expected, actual):
expected = etree.fromstring(expected)<EOL>if isinstance(actual, basestring):<EOL><INDENT>actual = etree.fromstring(actual)<EOL><DEDENT>state = XMLMatchState()<EOL>result = _compare_node(expected, actual, state, None)<EOL>if result is False:<EOL><INDENT>raise AssertionError("<STR_LIT>" % state)<EOL><DEDENT>elif result is not True:<EOL><INDENT>return result<EOL><DEDENT>
Compare two XML strings.