def get_xpath1(xml_node, path):
    """Given an XML node and XPath expression (a string), returns
       the node pointed to by this XPath. It is an error if there
       is no such node, or if there are multiple such nodes.

    xml_node -- XML DOM node (as returned from lxml.etree)
    path     -- XPath expression (as a string)
    """
    t = xml_node.xpath(path)
    u = len(t)

    if (0 == u):
        raise Exception("No node selected by XPath: {}".format(path))
    elif (2 <= u):
        raise Exception("Multiple nodes ({}) selected by XPath: {}".format(u, path))
    else:
        return t[0]     # return the only node in the list