def METHOD_NAME(klass, node, xml_space="preserve"):
    try:
        return klass(
            id=node.attrib["id"],
            rid=node.attrib.get("rid", None),
            xid=node.attrib.get("xid", None),
            xml_attrib=node.attrib,
        )
    except KeyError:
        pass
    return klass()