import sys from xml.etree import cElementTree as etree input_file = sys.stdin tree = etree.parse(input_file) print('\n'.join(elem.text for elem in tree.iter('build_location')))
<build_location> \\Datalocation\la\releases\3.2.0.21_JB2.2_RB2 </build_location>