#coding=utf-8 import sys from lxml import etree if __name__ == '__main__': xmlfile = sys.argv[1] doc = etree.ElementTree(file = xmlfile) for child in doc.findall('ql'): print(child.text)
<HiveQL > <ql>fff</ql> </HiveQL>
<HiveQL > <ql>f<ff</ql> </HiveQL>