141last_element=self._element_stack[-1]142try:143# if there already is a child element, we must append to its tail144last_element=last_element[-1]145last_element.tail=(last_element.tailor'')+data146exceptIndexError:147# otherwise: append to the text148last_element.text=(last_element.textor'')+data