    [clojure.zip :as zip :refer [children]]
    [slingshot.slingshot :refer [throw+ try+]]
    [clojure.data.zip.xml :refer [xml1-> text xml->]]))
+
+(defn get-elements [xml path]
+  (apply xml-> xml (concat [:DescribeLoadBalancersResult :LoadBalancerDescriptions :member] path)))
 
 (defn- get-listeners
   "returns a list of maps, very specific"

        (check-fixed-values)
        (ensure-health-check)
        (ensure-listeners))
    (create-elb local))

        ;    (ensure-security-groups)
                                        ;    (ensure-subnet)
  )

  (elb-request {"Action" "DeleteLoadBalancer"
                "LoadBalancerName" elb-name}))

(defn ensure-health-check [{:keys [local remote] :as config}]
  (let [remote-health-check (-> remote
                                (get-elements [:HealthCheck children])
                                (children-to-map))
        local-health-check (:HealthCheck local)]
;compare maps
    config))

(defn ensure-listeners [{:keys [local remote] :as config}]
  (let [remote-listenters (-> remote
                              (get-elements [:ListenerDescriptions :member children])
                              (filter-children :Listener)
                              (children-to-maps))]
    ; compare lists
    config))

(defn ensure-subnets [{:keys [local remote] :as config}]
  (let [remote-subnets (-> remote
                           (get-elements [:Subnets :member children]))]
                                        ; compare
    remote-subnets))

(defn ensure-security-groups [{:keys [local remote] :as config}]
  (let [remote-sg (-> remote
                      (get-elements [ :SecurityGroups :member children]))]

    config))

(defn ensure-config [local]
