'Compare XML objects.
Arguments:
xml    -- The XML object to compare against.
*other -- The list of XML objects to compare.'

def compare(self, xml, *other):

    if (not other):
        return False
    if (len(other) > 1):
        for xml2 in other:
            if (not self.compare(xml, xml2)):
                return False
        return True
    other = other[0]
    if (xml.tag != other.tag):
        return False
    if (xml.attrib != other.attrib):
        return False
    if (xml.text is None):
        xml.text = ''
    if (other.text is None):
        other.text = ''
    xml.text = xml.text.strip()
    other.text = other.text.strip()
    if (xml.text != other.text):
        return False
    if (len(list(xml)) != len(list(other))):
        return False
    for child in xml:
        child2s = other.findall(('%s' % child.tag))
        if (child2s is None):
            return False
        for child2 in child2s:
            if self.compare(child, child2):
                break
        else:
            return False
    for child in other:
        child2s = xml.findall(('%s' % child.tag))
        if (child2s is None):
            return False
        for child2 in child2s:
            if self.compare(child, child2):
                break
        else:
            return False
    return True
