(self, name, node=None)
Replaces the child nodes by ``name``

        :param node: replacement node or list of nodes

        ::

            n.append(Node('a'))
            n.append(Node('a'))
            n.replace('a', None)
            assert(len(n.get_all('a')) == 0)
Replaces the child nodes by ``name``
Replaces the child nodes by name
def replace(self, name, node=None):
        """
        Replaces the child nodes by ``name``

        :param node: replacement node or list of nodes

        ::

            n.append(Node('a'))
            n.append(Node('a'))
            n.replace('a', None)
            assert(len(n.get_all('a')) == 0)

        """
        if name:
            self.children = [c for c in self.children if c.name != name]
        if node is not None:
            if type(node) == list:
                for n in node:
                    self.children.append(n)
            else:
                self.children.append(node)
def replace ( self , name , node = None ) : if name : self . children = [ c for c in self . children if c . name != name ] if node is not None : if type ( node ) == list : for n in node : self . children . append ( n ) else : self . children . append ( node )