import xml.etree.ElementTree as etree e = etree.Element('eggs') e.ham1 = 1 e.ham2 = 2 print('Hello world!')