code: def elements_equal(first, *others):
      
      f = first
      lf = list(f)
      for e in others:
          le = list(e)
          if (len(lf) != len(le)
                  or f.tag != e.tag
                  or f.text != e.text
                  or f.tail != e.tail
                  or f.attrib != e.attrib
                  or (not all(map(elements_equal, lf, le)))
                  ):
              return False
      return True
docs: Check elements for equality