Use xml.etree.ElementTree to generate proper XML