📅  最后修改于: 2022-03-11 14:57:24.845000             🧑  作者: Mango
from lxml import etree
root = etree.parse('W2Testfile.xml')
sub = root.xpath('//SubmissionId')[0]
print(sub.text)
for tag in root.xpath('//DependentRelationshipCd'):
print(tag.text)