I want to replace a \"VAL1\" value of an element in xml file
For some reason it does not work for me:
TEST
There is no setValue method in Node or Element classes, see the docs for list of available methods. You can remove children of the element and append new text node like this:
setValue
$elem->removeChildNodes(); $elem->appendText('VAL2');