Loading Large XML Files

I have been working with large xml files ( ~20MB each ) using ofxXmlSettings.
It is very slow to load and save these files.
I got acceptable saving times by using a buffer and using strings, not a xml object.
Sample code here:

However, the loading of the xml files can take minutes.
Maybe it’s better to use plain strings, load that in from disk and parse the lines in the file instead of xml.
The methods provided by ofxXmlSettings are convenient but too slow with large files.
Current code I’m using for the loading of the files:

Any advice is appreciated. :slightly_smiling:

I created a file that held the appropriate commands and loaded it from buffer. It loaded in about a second, vs. several minutes in ofxXmlSettings

loading:

saving: