in reply to update a value in xml 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.