It works fine if I am updating node 'd'. But when I update node 'c', since there is no value in it and myNode1.getFirstChild() is null, even after executing the following statement, myNode1.setNodeValue(name);, the value of node 'c' is not updated.