code: public void writeBeginCollectionInfo(BioCCollection collection)
        throws XMLStreamException {
  
      if (hasWrittenCollectionInfo) {
        throw new IllegalStateException(
            "writeCollectionInfo can only be invoked once.");
      }
  
      hasWrittenCollectionInfo = true;
  
      writer
          .writeStartDocument(
              collection.getEncoding(),
              collection.getVersion(),
              collection.isStandalone())
          .writeBeginCollectionInfo(collection);
    }
docs: Writes the BioC collection information: source, date, key, infons, etc.
  
  @param collection the BioC collection whose information will be written
  @throws XMLStreamException if an unexpected processing error occurs