Update XML File Data

I have a request to update XML file data. I need tp update following nodes,


Glad some help on this.

1 Like

You need to write a Groovy code to do that. See the following


1 Like

Hi Kazrayam,

Thanks for your reply. After updating the node with new value, trying to save using following code.
new XmlNodePrinter(new PrintWriter(new FileWriter(xmlFile))).print(xml)
When I open the file, it is fully blank file. Any idea?


No. I have no idea.

It’s only you who can debug your code, as you haven’t disclosed your code at all.

It was my code that actually wasn’t updating the data properly caused the issue and now I am good it works fine! Thanks again your help. I really appreciated!


Please post the fix on here, thanks!

It was mostly how I was accessing the node. Also I had formatting issues after I saved the content the xml file. Following article helped me to fully fix the code.


1 Like