 
   Note that resources should be created by make-resources."
   [resources]
-  {:tag :Types
-   :attrs content-types-xml-xmlns
-   :content (into default-content-types
-                  (map resource-type-override resources))})
+  (node :Types content-types-xml-xmlns
+        default-content-types
+        (map resource-type-override resources)))
 
 (defn doc-props-app-xml
   "Creates XML data for docProps/app.xml file in DOCX pakcage.

             space-before space-after space-line   
             indent-left indent-right indent-first-line mirror-indents?]}]
  (let [font-style-name (str "character-style-of-" name)]
    (remove-nil
      [;; paragraph style
       {:tag :w:style
        :attrs {:w:type "paragraph"
                :w:styleId "normal"
                :w:customStyle "true"}
        :content
        (remove-nil
          [{:tag :w:name
            :attrs {:w:val name}}
           {:tag :w:basedOn
            :attrs {:w:val "a"}}
           (when font {:tag :w:link
                       :attrs {:w:val font-style-name}})
           {:tag :w:qFormat}
           (when (or align
                     space-before space-after space-line
                     indent-left indent-right indent-first-line mirror-indents?)
             (ppr options))
           (when (or font font-size font-color bold? italic? underline?)
             (rpr options))])}
       ;; font style of the paragraph style
       (when font
         {:tag :w:style
          :attrs {:w:type "character"
                  :w:styleId font-style-name
                  :w:customStyle "true"}
          :content
          [{:tag :w:name
            :attrs {:w:val font-style-name}}
           {:tag :w:basedOn
            :attrs {:w:val "a0"}}
           (rpr options)]})])))

(defn word-styles-xml
  "descripted on: http://officeopenxml.com/WPstyles.php"
  [& styles]
  {:tag :w:styles
   :attrs word-xmlns
   :content (remove-nil (flatten [default-styles styles]))})

(defn word-media-resources
  "Creates a vector of resource data map. Each map has :path and :byte-array

           space-before space-after space-line
           indent-left indent-right indent-first-line
           mirror-indents?]}]
  (node :w:pPr {}
        (when (or space-before space-after space-line)
          (node :w:spacing (make-attrs :w:before space-before
                                       :w:after space-after
                                       :w:line space-line
                                       :w:lineRule "auto")))
        (when (or indent-left indent-right indent-first-line)
          (node :w:ind (make-attrs :w:left indent-left
                                   :w:right indent-right
                                   :w:firstLine indent-first-line)))
        (when mirror-indents?
          (node :w:mirrorIndents))
        (when align
          (node :w:jc {:w:val align}))))

(defn- rpr
  "Creates w:rPr tag node. Called by paragaph-style."
  [{:as options
    :keys [font font-size font-color bold? italic? underline? strike?]}]
  (node :w:rPr {}
        (when font
          (node :w:rFonts {:w:ascii font
                           :w:hAnsi font
                           :w:eastAsia font}))
        (when font-size
          (node :w:sz {:w:val font-size}))
        (when font-color
          (node :w:color {:w:val font-color}))
        (when bold?
          (node :w:b {:w:val true}))
        (when italic?
          (node :w:b {:w:val true}))
        (when underline?
          (node :w:u {:w:val "single"}))
        (when strike?
          (node :w:strike {:w:val true}))))

(defn paragraph-style
  "Creates a w:style tag of paragraph. Returns w:style tag for paragraph style with
