testXML.py
import requests
from xml.etree import ElementTree as ET
#读取xml文件
tree = ET.parse("test.xml")
root = tree.getroot()
for node in root.iter('value'):
value = int(node.text) + 1
node.text = str(value)
node.set('name','jack')
tree.write("test.xml")
test.xml
<Date>
<a name="jack">
<value name="jack">1002</value>
</a>
<b name="tom">
<value name="jack">1002</value>
</b>
</Date>