QDomNode n = root.firstChild(); while( !n.isNull() ) { QDomElement e = n.toElement(); if( !e.isNull() ) { if( e.tagName() == "exercise" ) { if(name == e.attribute( "name", "" )) { e.removeAttribute("name"); e.removeAttribute("group"); e.removeAttribute("muscle"); e.removeAttribute("info"); e.removeAttribute("pic1"); e.removeAttribute("pic2"); e.removeAttribute("weight"); e.removeAttribute("status"); } } } n = n.nextSibling(); }