import xml.etree.ElementTree as ET

tree = ET.parse("./static/svg/maptest.svg")
root = tree.getroot()
print(root.tag)
for i in root:
    #i.set('transform', 'scale(10)')
    print(i.tag, i.attrib, i.get('style'))
    for ii in i:
        #print(ii.tag, ii.get('id'))
        target= ii.get('id')
        #print(target)
        l = target.split('_')
        #print(l)
        if 'x32' in l:
            print(l)
            ii.set('name', '2{}'.format(l[-1]))
        # for iii in ii:
        #     print(iii.tag,  iii.get('id'))
            # for iiii in iii:
            #     print(iiii.tag, iiii.get('id'))

tree.write('./static/svg/newmap.svg')