code: def replace_with(self, new_subsection):
          
          if self.subsection != new_subsection.subsection:
              raise exceptions.MetsError(
                  "Must replace a SubSection with one of the same type."
              )
          # TODO convert this to a DB so have bidirectonal foreign keys??
          self.newer = new_subsection
          new_subsection.older = self
          self.status = None
docs: Replace this SubSection with new_subsection.
  
          Replacing SubSection must be the same time.  That is, you can only
          replace a dmdSec with another dmdSec, or a rightsMD with a rightsMD etc.
  
          :param new_subsection: Updated version of this SubSection
          :type new_subsection: :class:`SubSection`