►
Run
# Python XML Parsing import xml.etree.ElementTree as ET root = ET.parse('sample.xml').getroot() # iterate over all nodes for holiday in root.findall('holiday'): # access element - name name = holiday.find('name').text print('name : ', name) # access element - date date = holiday.find('date').text print('date : ', date)
Output