     {:adjudicator/number 5}]},
   :round/dances [{:dance/name "Medium"} {:dance/name "Medium"}]}])
 
-(def activity-result (first activities-with-result))
-
-activity-result
+(defn activity-result [] ()first )
+
+
+(defn make-file-name-with-timestamp [file-name]
+
+  )
+
+(defn make-file-name-with-timestamp
+  ;; Adds the current time at the end
+  ;; of the filename
+  [file-name]
+  (let [time-now (t/now)
+        time-formatter (tf/formatters :hour-minute-second)
+        time-now-formatted (tf/unparse time-formatter time-now)
+        new-file-name (str file-name "." time-now-formatted)]
+    new-file-name
+    ))
+
+(defn make-copy-with-timestamp
+ ;; Copies the file and adds current time at the end
+ ;; of the filename.
+ [file-name]
+ (let [file-contents (slurp file-name)
+       new-file-name (make-file-name-with-timestamp file-name)]
+   (spit new-file-name file-contents)))
 
 (defn short-round-name [round-name]
   (condp = round-name

    (-> out .getWriter .toString)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; API

(defn tango-xml-encode [xml-str]
  (cstr/escape xml-str {
                        \Ö "&#214;"
                        \ö "&#246;"
                        \ä "&#228;"
                        \å "&#229;"
                        \é "&#233;"
                        })
  )

(tango-xml-encode "<Couple Seq=10\" Number=\"1090\" Name=\"Ebba Hellsten - Emmy Rapp\" Club=\"ND/ÖDT\" License=\"\"/>")

(defn export-results [activities-with-result export-path]
  (log/info (str "Export Results to " export-path " with " activities-with-result))
  (let [in-xml (get-xml-from-file export-path)
        class-results (map activity-result->class-result activities-with-result)
        ;out-xml (add-results-to-dp-xml in-xml (first class-results))
        out-xml (reduce add-results-to-dp-xml in-xml class-results)
        ]
    (with-open [w (java.io.FileWriter. "bar.xml")]
      (xml/emit out-xml w)) 
    ))
(map activity-result->class-result activities-with-result)
(activity-result->class-result activities-with-result)

(defn smoke-test [] (export-results activities-with-result "dp.xml"))

(smoke-test)


            :result-array (result-facts->result-array (:result/_activity activity-result))
            }})

;; Provides useful Timbre aliases in this ns
(log/refer-timbre)

