import xml.etree.ElementTree as ET import arcpy xmlfile = 'D:/Working/Test/Test.xml' element_tree = ET.parse(xmlfile) root = element_tree.getroot() agreement = root.find(".//agreementid").text arcpy.AddMessage(agreement)