I was trying to export all themes and its corresponding layers information through PyQGIS so that
xml can be read later .There is method in
Class: QgsMapThemeCollection, writeXml(self, doc: QDomDocument) but cannot able to write into xml file.
Below code has been tried but cannot able to write.
doc = QDomDocument() qgsl = QgsProject.instance() mTC = qgsl.mapThemesCollection() mTs = mTC.mapThemes() mTc.writeXml(doc)