   ;; fact that those types of nodes are relatively rare in XML.
   
   (let [;; Use defaults for options unless overridden.
+        opts (merge *parse-options* opts)
         {:keys [namespaces
                 comments cdata processing-instructions
-                keep-whitespace]} (merge *parse-options* opts)
+                keep-whitespace]} opts
 
         ;; First, run the SAX parser to produce the full sequence of
         ;; events. Give it the nice short name "e", since it will be

  (tag [this] tag)
  (attrs [this] attrs)
  (content [this] content)
  (uri [this] uri))

(defrecord Comment [^String text])


                (assert (= (end-cdata 0) :end-cdata) "Expected :end-cdata event.")
                (recur (conj nodes (CData. (apply str (map second text-nodes))))
                       events
                       md-stack))

              :processing-instruction
              (let [[_ target text] evt]
                (recur (conj nodes (PI. target text))
                       events
                       md-stack))

              (:end-element nil)
              [nodes events]
