def get_tag_index(node, tag):
    """Return the (first) index of tag in node.

    If tag is not found, -1 is returned.
    """
    for i, elem in enumerate(list(node)):
        if elem.tag == tag:
            return i
    return -1
