def METHOD_NAME (self, name):
    text = ''.join (self._text_parts).strip()
    if text:
        self.current._data = text
    if self.current.attributes():
        obj = self.current
    else:
        # a text only node is simply represented by the string
        obj = text or ''
    self.current, self._text_parts = self._stack.pop()
    self.current._add_xml_attr (TreeBuilder._name_mangle(name), obj)