编辑器
import xml.etree.ElementTree as ET xml_data = '
Tobias
25
' root = ET.fromstring(xml_data) print(f'Name: {root.find("name").text}') print(f'Age: {root.find("age").text}')
Name: Tobias
Age: 25