code: def reset_from_xml_string(self, xml_string):
          
  
          # if there is an active viewer window, destroy it
          self.close()
  
          # load model from xml
          self.mjpy_model = load_model_from_xml(xml_string)
  
          self.sim = MjSim(self.mjpy_model)
          self.initialize_time(self.control_freq)
          if self.has_renderer and self.viewer is None:
              self.viewer = MujocoPyRenderer(self.sim)
              self.viewer.viewer.vopt.geomgroup[0] = (
                  1 if self.render_collision_mesh else 0
              )
              self.viewer.viewer.vopt.geomgroup[1] = 1 if self.render_visual_mesh else 0
  
              # hiding the overlay speeds up rendering significantly
              self.viewer.viewer._hide_overlay = True
  
          elif self.has_offscreen_renderer:
              render_context = MjRenderContextOffscreen(self.sim)
              render_context.vopt.geomgroup[0] = 1 if self.render_collision_mesh else 0
              render_context.vopt.geomgroup[1] = 1 if self.render_visual_mesh else 0
              self.sim.add_render_context(render_context)
  
          self.sim_state_initial = self.sim.get_state()
          self._get_reference()
          self.cur_time = 0
          self.timestep = 0
          self.done = False
  
          # necessary to refresh MjData
          self.sim.forward()
docs: Reloads the environment from an XML description of the environment.