See [the docs](https://docs.python.org/3/library/xml.etree.elementtree.html) ```py import xml.etree.ElementTree as ET tree = ET.parse('country_data.xml') root = tree.getroot() root = ET.fromstring(country_data_as_string) root.tag root.attrib for child in root: print(child.tag, child.attrib) root[0][1].text ``` See example xml below ```py for neighbor in root.iter('neighbor'): # iterate recursively finding neighbor elements print(neighbor.attrib) for country in root.findall('country'): # direct descendents only rank = country.find('rank').text # first matching name = country.get('name') print(name, rank) ``` ### Example XML ```xml 1 2008 141100 4 2011 59900 68 2011 13600 ```