def rename_elements(elements, rename_dict):
    """ Rename elements. """
    for k in range(elements.getSize()):
        e = elements.get(k)
        for id_old, id_new in rename_dict.items():
            e.renameSIdRefs(id_old, id_new)
