     node))
 
 (defn mount! [element child]
-  (when-let [last-child (.-lastChild (get-dom-node element))]
+  (when-let [last-child (.-lastChild element
+                        ;; (get-dom-node element)
+                          )]
     (remove! last-child))
   (append-child! element child))

     (do-show-element parent new-elem cur-elem))))

(defn- clear-children! [parent]
  (let [dom-node (get-dom-node parent)]
    (loop []
      (let [last-child (.-lastChild dom-node)]
        (when last-child

       :private true}
     re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")

(def ^:dynamic *xml-namespaces* nil)

(defn- get-xml-namespace [kw-ns]
  (let [xmlns (get *xml-namespaces* kw-ns)]
    (assert xmlns (str "Don't know how to handle namespace " kw-ns))))

(defn- create-dom-node [kw]
  (let [tag-ns (namespace kw)
        [_ tag id class] (re-matches re-tag (name kw))
        node (if tag-ns
               (let [resolved-ns
                     (if (= tag-ns "svg")
                       "http://www.w3.org/2000/svg"
                       (get-xml-namespace tag-ns))]
                 (.createElementNS js/document resolved-ns tag))
               (.createElement js/document tag))]
    (when id (set! (.-id node) id))
    (when class (set! (.-className node) (.replace class "." " ")))
    node))
