'Return True iff elem has no child tags and no text content'

def is_empty(self, elem):

    for child in elem:
        if child.tail:
            return False
    return ((len(tuple(elem.iterchildren(u'*'))) == 0) and (not elem.text))
