A parsed model or one returned by createProject.
Required output version.
XML string. An XML declaration, when present, specifies UTF-8 encoding.
QgsError INVALID_VERSION for an invalid target, or INVALID_EDIT
for duplicate IDs, cycles, non-finite numbers, edits that would lose data, project
property keys that QGIS 3 cannot store, or other invalid model data.
Write a model as QGS XML for a specified QGIS 3 or 4 version.
The same model can be written for different versions without mutation. Known format differences are converted; unknown data and order are reconstructed from extensions. Features unavailable in the target QGIS are not substituted, and compatibility of the entire project is not checked.