class Element(object):
    tag = None
attrib = None
text = None
tail = None

def __init__(self, tag, attrib={}, **extra):
    attrib = attrib.copy()
attrib.update(extra)
self.tag = tag
self.attrib = attrib
self._children = []
How to set ElementTree Element text field in the constructor