human
Complete the below
def compare_xml(want, got):

    ''''Try to do a \'xml-comparison\' of want and got. Plain string comparison
    doesn\'t always work because, for example, attribute ordering should not be
    important. Ignore comment nodes and leading and trailing whitespace.
    Based on https://github.com/lxml/lxml/blob/master/src/lxml/doctestcompare.py'
    '''
 Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    _norm_whitespace_re = re.compile('[    \\t\\n][    \\t\\n]+')
    def norm_whitespace(v):
        return _norm_whitespace_re.sub('    ', v)
    def child_text(element):
        return ''.join((c.data for c in element.childNodes if (c.nodeType == Node.TEXT_NODE)))
    def children(element):
        return [c for c in element.childNodes if (c.nodeType == Node.ELEMENT_NODE)]
    def norm_child_text(element):
        return norm_whitespace(child_text(element))
    def attrs_dict(element):
        return dict(element.attributes.items())
    def check_element(want_element, got_element):
        if (want_element.tagName != got_element.tagName):
            return False
        if (norm_child_text(want_element) != norm_child_text(got_element)):
            return False
        if (attrs_dict(want_element) != attrs_dict(got_element)):
            return False
        want_children = children(want_element)
        got_children = children(got_element)
        if (len(want_children) != len(got_children)):
            return False
        for (want, got) in zip(want_children, got_children):
            if (not check_element(want, got)):
                return False
        return True
    def first_node(document):
        for node in document.childNodes:
            if (node.nodeType != Node.COMMENT_NODE):
                return node
    want = want.strip().replace('\\n', '\n')
    got = got.strip().replace('\\n', '\n')
    if (not want.startswith('<?xml')):
        wrapper = '<root>%s</root>'
        want = (wrapper % want)
        got = (wrapper % got)
    want_root = first_node(parseString(want))
    got_root = first_node(parseString(got))
    return check_element(want_root, got_root)