doc = etree.parse(fp)
fp.close()
for record in doc.xpath('//datafield'):
    print(record.xpath('./@tag')[0])
for x in record.xpath('./subfield/text()'):
    pass
Parse xml with lxml - extract element value