Is it possible to load *.filtergraph from plugin host into my own plugin?

Hi, I’m building a plugin that needs a customized effect chain, which may consist of other plugins. And this effect chain may be constantly modified. To achieve this, I want to define my graph first in pluginhost and then use the saved *.filtergraph files.

I’m tracing codes of AudioPluginHost. My plan is to use loadDocument and restoreFromXml in PluginGraph.cpp to get AudioProcessorGraph. Then apply it to processBlock of a plugin processor. Am I in the right direction? If so, what should I pay attention to when implementing?