                                    :id     (:id component)
                                    :name   (:name component)}})})))
 
+(defn components-to-chapter->xml
+    "Convert list of components into XML file."
+    [components]
+    (with-out-str
+        (xml/emit {:tag :components :content
+            (for [component components]
+                {:tag :component :attrs {
+                                   :name    (:component component)
+                                   :chapter (:chapter component)}})})))
+
 (defn products->csv
     "Convert list of products into CSV file."
     [products]

        :csv  (components->csv   component-list)
        :edn  (data->edn         component-list)))


                     (for [component components]
                          [(:id component) (:name component)]))))

(defn components-to-chapter->csv
    "Convert list of components into CSV file."
    [components]
    (data->csv (cons ["Component name" "Chapter name"]
                     (for [component components]
                          [(:component component) (:chapter component)]))))

(defn product-output-data
    "Export product list into selected output format."
    [output-format product-list]
