(self, name, text, node=None)
return node
create an element with a text node embedded

        DO NOT USE "node" ARGUMENT

        FIXME: the "node" argument here is wrong.  It overides the element
        created and renders "name" useless".  This cannot be fixed here.  A
        new method has to replace this one to fix it because too much may
        depend on it.
create an element with a text node embedded
create an element with a text node embedded
def create_text_element(self, name, text, node=None):
        '''create an element with a text node embedded

        DO NOT USE "node" ARGUMENT

        FIXME: the "node" argument here is wrong.  It overides the element
        created and renders "name" useless".  This cannot be fixed here.  A
        new method has to replace this one to fix it because too much may
        depend on it.
        '''
        text_node = self.doc.createTextNode(text)
        if not node:
            node = self.create_element(name)
            node.appendChild(text_node)
        else:
            first = node.firstChild
            if first:
                node.replaceChild(text_node, first)
            else:
                node.appendChild(text_node)
        return node
def create_text_element ( self , name , text , node = None ) : text_node = self . doc . createTextNode ( text ) if not node : node = self . create_element ( name ) node . appendChild ( text_node ) else : first = node . firstChild if first : node . replaceChild ( text_node , first ) else : node . appendChild ( text_node ) return node