def match_empty ( self , el ) : is_empty = True for child in self . get_children ( el , tags = False ) : if self . is_tag ( child ) : is_empty = False break elif self . is_content_string ( child ) and RE_NOT_EMPTY . search ( child ) : is_empty = False break return is_empty
how to check if a tag is empty is xml python
Check if element is empty ( if requested ) .
def match_empty(self, el):
        """Check if element is empty (if requested)."""

        is_empty = True
        for child in self.get_children(el, tags=False):
            if self.is_tag(child):
                is_empty = False
                break
            elif self.is_content_string(child) and RE_NOT_EMPTY.search(child):
                is_empty = False
                break
        return is_empty