code: def write_change_list(self, paths=None, outfile=None, ref_sitemap=None, newref_sitemap=None,
                            empty=None, links=None, dump=None):
          
          cl = ChangeList(ln=links)
          if (not empty):
              # 1. Get and parse reference sitemap
              old_rl = self.read_reference_resource_list(ref_sitemap)
              # 2. Depending on whether a newref_sitemap was specified, either read that
              # or build resource list from files on disk
              if (newref_sitemap is None):
                  # Get resource list from disk
                  new_rl = self.build_resource_list(paths=paths, set_path=dump)
              else:
                  new_rl = self.read_reference_resource_list(
                      newref_sitemap, name='new reference')
              # 3. Calculate change list
              (same, updated, deleted, created) = old_rl.compare(new_rl)
              cl.add_changed_resources(updated, change='updated')
              cl.add_changed_resources(deleted, change='deleted')
              cl.add_changed_resources(created, change='created')
          # 4. Write out change list
          cl.mapper = self.mapper
          cl.pretty_xml = self.pretty_xml
          if (self.max_sitemap_entries is not None):
              cl.max_sitemap_entries = self.max_sitemap_entries
          if (outfile is None):
              print(cl.as_xml())
          else:
              cl.write(basename=outfile)
          self.write_dump_if_requested(cl, dump)
docs: Write a change list.
  
          Unless the both ref_sitemap and newref_sitemap are specified then the Change
          List is calculated between the reference an the current state of files on
          disk. The files on disk are scanned based either on the paths setting or
          else on the mappings.