Storing filtergraph state in my application xml file

I wonder if it’s a good idea to do so?
My app is a plugin host,
and I am trying to add the filtergraph settings in a subtree of my app’s xml file.

Saving looks nice, but at some point my loading procedure has to call ValueTree::fromXml (*xml).
And this asserts, once pointing to the node :
// ValueTrees don’t have any equivalent to XML text elements!
Would there be a workaround?
Thanks

You’re definitely on the right track in terms of how to store a filtergraph, but it seems like this error is due to you trying to load an xml text element into a value tree using fromXml. Given your use, and given how easy a mistake this could be, I suspect you’re trying to create a value tree from the xml text element generated by PluginGraph::createXml(), which isn’t a valueTree (it’s an XmlElement). As the documentation for juce::ValueTree::fromXML suggests, it isn't designed to cope with random XML data - it should only be fed XML that was created by the createXml() method.

Ah, yes, OK, but (and I forgot to mention that, sorry): the place where it is stuck when trying to read the xml file, is .
Right, the function called for creating the xml file was producing an XmlElement. But now, is there a solution to store the filterGraph state in my xml project file, which is properly formed XML (afaik) apart from this node ? Because I need to load a ValueTree from this file anyway…

Well, you need to store both the filtergraph and all the other settings you want to store in one file, but it’s up to you how you want to do that. I’d suggest writing everything into one XmlElement and then recreating the settings you want from there.

OK, thanks!