I have searched a ton for an example of someone using the XmlElement::writeTo() method, but I can’t find anything on how to use it. My main problem is that I don’t know what format to put the parameters in, but this is what I have so far, I am sure it is incorrect.
You can supply a string literal or any other type that’s convertible to String as the first parameter because the File class has a non-explicit constructor that takes a String (meaning you can just do data->writeTo ("/My/File/Path") instead of data->writeTo (juce::File ("/My/File/Path")).
The second parameter can actually be left out entirely, since it has a default value which is an empty TextFormat object.
I personally prefer the data->writeTo style over data->XmlElement::writeTo, since it should be trivial to find out that data is an XmlElement type. This is also the more common style, in my experience.