def METHOD_NAME(self, node):
    if isinstance(node, tuple):
        element, key, parents, flag = node
    else:
        element, key, parents, flag = node, None, [], None
    if flag in ("text", "tail"):
        return None
    else:
        if element.text:
            return element, key, parents, "text"
        elif len(element):
            parents.append(element)
            return element[0], 0, parents, None
        else:
            return None