code: def export_to_file(self, filepath, level_prefix = '  '):
          
          xmldom = self.export_to_dom()
          xmlstr = xmldom.toprettyxml(level_prefix, '\n',)
  
  
          f = open(filepath, 'w')
          f.write(xmlstr)
          f.close()
docs: Exports this model to a file.
  
          @param filepath: File to be exported to.
          @type filepath: str