def METHOD_NAME(root):
    cropfactors = {}
    for element in root.xpath("lens"):
        cropfactors.setdefault(get_model(element), set()).add(element.xpath("cropfactor")[0].text)
    for element in root.xpath("lens"):
        cropfactor_element = element.xpath("cropfactor")[0]
        cropfactor_element.tag = "min-crop-factor"
        cropfactor_element.text = str(min(cropfactors[get_model(element)]))