def METHOD_NAME(self, node):
    assert not isinstance(node, tuple), "Text nodes have no children"
    assert len(node) or node.text, "Node has no children"
    if node.text:
        return (node, "text")
    else:
        return node[0]