public void renameNodesWithAttributeValue ( String oldName , String newName , String attributeName , String attributeValue ) { List < Node > nodes = getNodesFromTreeByName ( oldName ) ; Iterator i = nodes . iterator ( ) ; while ( i . hasNext ( ) ) { Node n = ( Node ) i . next ( ) ; n . setName ( newName ) ; } }
Rename all nodes with a certain name and a certain attribute name - value pair