 
 (defn- node->account
   [node]
-  (with-namespace-context namespace-map
-    (let [account (node->model node account-attributes)]
-      (-> account
-          (assoc :commodity {:exchange (when-let [exchange (:commodity-exchange account)]
-                                         (-> exchange
-                                             s/lower-case
-                                             keyword))
-                             :symbol (:commodity-symbol account)})
-          (dissoc :commodity-exchange :commodity-symbol)
-          (with-meta {:record-type :account
-                      :ignore? (ignored-accounts (:name account))})))))
+  (let [account (node->model node account-attributes)]
+    (-> account
+        (assoc :commodity {:exchange (when-let [exchange (:commodity-exchange account)]
+                                       (-> exchange
+                                           s/lower-case
+                                           keyword))
+                           :symbol (:commodity-symbol account)})
+        (dissoc :commodity-exchange :commodity-symbol)
+        (with-meta {:record-type :account
+                    :ignore? (ignored-accounts (:name account))}))))
 
 (defmethod process-node :gnc:account
   [node]


(defmethod process-node :gnc:budget
  [node]
  (-> node
      (node->model budget-attributes)
      (assoc :items (map node->budget-item ($x "bgt:slots/slot" node)))
      (with-meta {:record-type :budget})))

(def ^:private commodity-attributes
  [{:attribute :exchange


(defn- append-trading-attributes
  [transaction node]
  (with-namespace-context namespace-map
    (if (= :buy (:action transaction))
      (let [commodity-item-node (first ($x "trn:splits/trn:split[split:action = \"Buy\"]" node))
            commodity-account-node (first ($x (format "//gnc:book/gnc:account[act:id = \"%s\"]"
                                                      ($x:text "split:account" commodity-item-node))
                                              node))
            symbol ($x:text "act:commodity/cmdty:id" commodity-account-node)
            exchange (keyword (s/lower-case ($x:text "act:commodity/cmdty:space" commodity-account-node)))]
        (assoc transaction
               :shares (parse-decimal ($x:text "split:quantity" commodity-item-node))
               :commodity-account-id ($x:text "split:account" commodity-item-node)
               :account-id ($x:text "act:parent" commodity-account-node)
               :symbol symbol
               :exchange exchange))
      transaction)))

(defmethod process-node :gnc:transaction
  [node]
