Optimize performance by using lxml.etree to replace ElementTree