code: def to_file(self, path):
          
          with open(os.path.expanduser(path), "w") as ofile:
              ofile.write(self.__repr__())
docs: Write object XML to path.
  
          Args:
              path: String file path to the file you wish to (over)write.
                  Path will have ~ expanded prior to opening.