Running Depletion calculation in XML

I currently have a set of XML files that run properly. Is it possible to run a depletion calculation by specifying settings in an XML file. If not, is it possible to load existing XML files into a python script, so that only the depletion portion has to be written in Python?

Yes, it is indeed possible to do this. The Model class has a from_xml method that can be used to recreate the model from a set of XML files. The model can then be passed into the depletion Operator:

model = openmc.Model.from_xml()  # <-- run in directory with .xml files
op = openmc.deplete.Operator(model, ...)
...

This might be a bit of a stretch, but I’ll ask here in an attempt to not start a new post for a similar topic.

I know that OpenMC is moving towards to export_to_model_xml(), but when I run depletion with an existing model.xml file and use model = openmc.Model.from_model_xml()
before passing to my operator/integrator, it recreates the other XML.

It seems like the CoupledOperator initial_condition method is responsible (see below)

        # Create XML files
        if comm.rank == 0:
            self.model.geometry.export_to_xml()
            self.model.settings.export_to_xml()
            if self.model.plots:
                self.model.plots.export_to_xml()
            if self.model.tallies:
                self.model.tallies.export_to_xml()
            self._generate_materials_xml()

I actually get a warning about the mix-and-match XML when I run depletion this way

 Reading model XML file 'model.xml' ...
 WARNING: Other XML file input(s) are present. These files may be ignored in
          favor of the model.xml file.
 Reading cross sections XML file...

Is the best practice to not use model.xml for depletion or is it fine to do so? Perhaps one day this method will export a model.xml, but IIRC the actual materials.xml file is used during the depletion simulation? Though depletion_results.h5 stores all the isotope data at every step anyways.