#!/usr/bin/python3
import xml.etree.ElementTree as ET
.
file = ET.parse(r'test.xml')
.
for node in file.getroot():
print(node)
firstname = node.findall('{http://tempuri.org/sdnList.xsd}firstName')
print(firstname)
Output:
<Element '{http://tempuri.org/sdnList.xsd}publshInformation' at 0xb74ffd24>
[]
<Element '{http://tempuri.org/sdnList.xsd}sdnEntry' at 0xb74ffdc4>
[<Element '{http://tempuri.org/sdnList.xsd}firstName' at 0xb74ffe14>]
<Element '{http://tempuri.org/sdnList.xsd}sdnEntry' at 0xb7502554>
[<Element '{http://tempuri.org/sdnList.xsd}firstName' at 0xb75025a4>]
...
...
...