Example1:Reading xml file data..!! import xml.etree.cElementTree as ET tree=ET.ElementTree(file='books.xml') root=tree.getroot() for data in root: print(data.get('id'))
Example: python elementtree load from string
from xml.etree.ElementTree import XML, fromstring
myxml = fromstring(text)