Cleanup the XML parsing using ElementTree API