Create a simple DOM and having it serialize to:

 <?xml version="1.0" ?>
 <root>
     <element>
         Some text here
     </element>
 </root>

 
(require '[clojure.data.xml :as xml])
 
(def xml-example (xml/element :root {} (xml/element :element {} "Some text here")))
 
(with-open [out-file (java.io.OutputStreamWriter.
                        (java.io.FileOutputStream. "/tmp/output.xml") "UTF-8")]
  (xml/emit xml-example out-file))
 