legacy/src/main/java/thredds/catalog/InvCatalogFactory.java
public void writeXML(InvCatalogImpl catalog, String filename) throws IOException {
    BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(filename));
    writeXML(catalog, os, false);
    os.close();
  }
public void writeXML(InvCatalogImpl catalog, String filename) throws IOException {
    BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(filename));
    writeXML(catalog, os, false);
    os.close();
  }
/*
Write the catalog as an XML document to the specified filename.

@param catalog  write this catalog
@param filename write to this filename
@throws IOException on an error.