code: public void writeDocument(String filename, Document document) {
              ProvFormat format = getTypeForFile(filename);
              if (format == null) {
                  System.err.println("Unknown output file format: " + filename);
                  return;
              }
          writeDocument(filename, format, document);
      }
docs: Write a {@link Document} to file, serialized according to the file extension
  @param filename path of the file to write the Document to
  @param document a {@link Document} to serialize