def validate_matched_node(matched_nodes, tag):
    """Takes the output from a Element.findall() (A list of elements) and checks
    that there is only one matched node and that it is of the specified type

    Args:
        matched_nodes: List of zero, one or more nodes - anything other than one
            is an error.
        tag:
    """
    if len(matched_nodes) == 1 and matched_nodes[0].tag == tag:
        return matched_nodes[0]
    else:
        return None
