def format_xpaths(xpath_map, *args, **kwargs):
    """ :return: a copy of xpath_map, but with XPATHs formatted with ordered or keyword values """

    formatted = {}.fromkeys(xpath_map)

    for key, xpath in iteritems(xpath_map):
        formatted[key] = xpath.format(*args, **kwargs)

    return formatted