Generate form from XML I have a standard form structure with fieldsets etc. I'm trying to populate my form into various nodes. This means that the same form will be displayed on more than one nodes. For every node, the form's fields will be enabled or disabled. This depends from XML files where it is described which fields will be enabled or disabled. This is a complex problem where i don't know how to start searching.
I'm not sure about D8, but for a D7 site I would read the XML file within a hook_form_alter() function, and use this to select enabled or disabled each form element depending on the rules set forth within the XML.

Of course as lovely, or convoluted as that sounds, it's a pretty nasty performance hit to show a form so caching would be important here.

I hope I understood your question correctly.