     (let [xs [[:buffer-size #(.setBufferSize cco %)]
               [:collections #(.setCollections cco (into-array String %))]
               [:encoding    #(.setEncoding cco %)]
-              [:format      #(.setFormat cco (doc-format %))]
+              [:format      #(.setFormat cco (->doc-format %))]
               [:graph       #(.setGraph cco %)]
               [:language    #(.setLanguage cco %)]
               [:locale      #(.setLocale cco %)]

   :none   DocumentFormat/NONE
   :binary DocumentFormat/BINARY})

(def doc-repair-level
  "Enumeration of document repair levels. Used at insertion time.
  See https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/DocumentRepairLevel.html"
  {:default DocumentRepairLevel/DEFAULT
   :full    DocumentRepairLevel/FULL
   :none    DocumentRepairLevel/NONE})

(def content-capability
  "Enumeration of content permission capability values.
  See https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/ContentCapability.html"
  {:execute ContentCapability/EXECUTE
   :insert  ContentCapability/INSERT
   :read    ContentCapability/READ
   :update  ContentCapability/UPDATE})

(def transaction-modes
  "Enumeration of valid Session transaction modes. See
  https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/Session.TransactionMode.html"
  {:auto Session$TransactionMode/AUTO
   :query Session$TransactionMode/QUERY

                                   transaction-mode transaction-timeout]}]
   (let [session (create-session* db-info content-source)]
     (when (map? default-request-options)
       (.setDefaultRequestOptions session (make-request-options default-request-options)))
     (when (instance? Logger logger)
       (.setLogger session logger))
     ;; XXX the following is not the strictest test!
     (when (instance? Object user-object)
       (.setUserObject session user-object))
     (when (keyword? transaction-mode)
       (.setTransactionMode session (->transaction-mode transaction-mode)))
     (when (integer? transaction-timeout)
       (.setTransactionTimeout session transaction-timeout))
     session)))
