def METHOD_NAME(self):
    try:
        return self.node.attrib["id"]
    except KeyError:
        ...
    try:
        return self._parent_node_with_id.get("id")
    except (AttributeError, TypeError):
        ...
    return ""