           (emit-xml child out))
         (doto out
           (.write "</")
-          (.write (name tag))
+          (.write tagname)
           (.write ">"))))))
 
 (defn emit-comment [^Comment c ^Writer out]

  (tag [this] "Return the tag of the element")
  (attrs [this] "Return a map of the attributes of the element")
  (content [this] "Return a sequence of children of the element")
  (uri [this] "Return the namespace URI of the element"))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      xml-escape
      (.replaceAll "'"  "&apos;")))

(defn emit-attr [k v ^Writer out]
  (.write out " ")
  (if (keyword? k)))

(defn emit-element [^Element e ^Writer out]
  (let [tag (tag e)
        attrs (attrs e)
        content (content e)
        prefix (prefix e)
        tagname (str prefix (if prefix \:) (name tag))]
    (doto out
      (.write "<")
      (.write tagname))
    (doseq [[k v] attrs]
      (if-not (nil? v)
        (doto out
