in reply to update a value in xml file

You only ever change the value in the string in your program, and never write it back to the file.

Since in-place edits are quite error prone, I'd suggest to write a copy with the updated content, and then delete the original and rename the copy.