def METHOD_NAME(self, node):
    if isinstance(node, tuple):  # Text node
        node, key = node
        assert key in ("text", "tail"), "Text nodes are text or tail, found %s" % key
        if key == "text":
            return node
        # else: fallback to "normal" processing
    elif node in self.fragmentChildren:
        return None
    return node.getparent()