docs: def _close(self):
          """
          Append the xml fact list to the main document write file and cleanup.
  
          ``toxml`` should take care of encoding everything with UTF-8.
          """
  
          self.document.appendChild(self.fact_list)
          self.file.write(self.document.toxml(encoding='utf-8'))
          return super(XMLWriter, self)._close()