void removeNamedElementsRecursive (const QStringList &names, QDomNode &parent) {
		QDomNode nchild;

		for (QDomNode child = parent.firstChild (); !child.isNull (); child = nchild) {
			removeNamedElementsRecursive (names, child);

			nchild = child.nextSibling ();		// need to fetch next sibling here, as we might remove the child below
			if (child.isElement ()) {
				QDomElement e = child.toElement ();
				if (names.contains (e.attribute ("name"))) {
					parent.removeChild (child);
				}
			}
		}
	}
	void removeContainers (KXMLGUIClient *from, const QStringList &names, bool recursive) {
		QDomDocument doc = from->xmlguiBuildDocument ();
		if  (doc.documentElement ().isNull ()) doc = from->domDocument ();
	
		QDomElement e = doc.documentElement ();
		removeNamedElementsRecursive (names, e);
		from->setXMLGUIBuildDocument (doc);
	
		if (recursive) {
			QList<KXMLGUIClient*> children = from->childClients ();
			QList<KXMLGUIClient*>::const_iterator it;
			for (it = children.constBegin (); it != children.constEnd (); ++it) {
				removeContainers ((*it), names, true);
			}
		}
	}
	void removeContainers (KXMLGUIClient *from, const QStringList &names, bool recursive) {
		QDomDocument doc = from->xmlguiBuildDocument ();
		if  (doc.documentElement ().isNull ()) doc = from->domDocument ();
	
		QDomElement e = doc.documentElement ();
		removeNamedElementsRecursive (names, e);
		from->setXMLGUIBuildDocument (doc);
	
		if (recursive) {
			QPtrList <KXMLGUIClient> *children = const_cast<QPtrList <KXMLGUIClient> *> (from->childClients ());
			if (children) {
				for (KXMLGUIClient *child = children->first (); child; child = children->next ()) {
					removeContainers (child, names, true);
				}
			}
		}
	}
void TextEditor::modifyToolBar(KTextEditor::View *view)
{
    //we don't want all the actions to be visible.
    //Q:why?
    //A:because Plasmate doesn't use actions like save and save as, automatically it saves
    //the projects

    //see this page, http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology

    QStringList names;
    names << "file_save" << "file_save_as";

    QDomDocument doc = view->xmlguiBuildDocument();
    if  (doc.documentElement().isNull()) {
        doc = view->domDocument();
    }

    QDomElement e = doc.documentElement();
    removeNamedElementsRecursive(names, e);
    view->setXMLGUIBuildDocument(doc);

}