This is fine, however each time the code is used, it overwrites what is in recording.xml whereas I want it to add to the file so I have a lot of records rather than just one.
If you want to do it many times during the application lifetime, it’s probably best to load the xml in the setup() method and to save it in the exit() method.