def METHOD_NAME(node, use_id=True):
    # index of node
    counter = 1
    for tag in node.previous_siblings:
        if type(tag) != bs4.element.Tag:
            continue
        elif tag.name == node.name:
            counter += 1
    # XPath name
    if counter > 1:
        xpath = node.name + "[%d]" % counter
    else:
        xpath = node.name
    return xpath