def METHOD_NAME(filepath, keypairs, count):
    root = ET.parse(filepath).getroot()
    td = root.find('upper_seed')
    elems = td.findall('peer/pubkey')
    for x in range(0, count):
        keypair = keypairs[x].split(" ")
        elems[x].text = keypair[0]
    tree = ET.ElementTree(root)
    tree.write(filepath)