   objects. See source-seq and parse."
   [events]
   (ffirst
-    (seq-tree
-      (fn [^Event event contents]
-        (when (= :start-element (.type event))
-          (Element. (.name event) (.attrs event) contents)))
-      (fn [^Event event] (= :end-element (.type event)))
-      (fn [^Event event] (.str event))
-      events)))
+   (seq-tree
+    (fn [^Event event contents]
+      (when (= :start-element (.type event))
+        (Element. (.name event) (.attrs event) contents)))
+    (fn [^Event event] (= :end-element (.type event)))
+    (fn [^Event event] (.str event))
+    events)))
 
 (defprotocol AsElements
   (as-elements [expr] "Return a seq of elements represented by an expression."))

                             XMLStreamConstants)
           (java.nio.charset Charset)
           (java.io Reader)))
(set! *warn-on-reflection* true)
; Represents a parse event.
; type is one of :start-element, :end-element, or :characters
(defrecord Event [type name attrs str])

  (let [fac (doto (javax.xml.stream.XMLInputFactory/newInstance)
              (.setProperty javax.xml.stream.XMLInputFactory/IS_COALESCING true))
        sreader (.createXMLStreamReader fac s)]
    (doall (pull-seq sreader))))

(defn parse
  "Convenience function. Parses the source, which can be a File,
