     (-> dom-serializer
         (.createDOM tag-node))))
 
+(def file-format-ignore-regex #".jpg$|.css$|.gif$|.png$")
+
 (defn minimum-maximal-xpath-set-processed
   "This helper routine exists so we don't reparse
 the page several times"

                         second
                         (anchor-tag-xpaths-nodes a-tags))))]

    (-> (reduce
         (fn [acc xpath]
           (let [xpath-links (set
                              (map #(-> % :attrs :href)
                                   ($x xpath processed-pg)))]
             (if (= (clj-set/intersection (:links acc) xpath-links)
                    xpath-links)
               acc
               (merge-with clj-set/union acc {:links  xpath-links
                                              :xpaths #{xpath}}))))
         {:xpaths (set [])
          :links  (set [])}
         xpaths-a-tags))))

(defn minimum-maximal-xpath-set
  "A maximal xpath set is a set of xpaths
sufficient to span all the anchor tags on a 
page. The minimum here refers to the cardinality
of the xpath set."
  [page-src]
  (minimum-maximal-xpath-set-processed (html->xml-doc page-src)))

(defn node-path-to-root
  "A version of path-root-seq for

            [clojure.string :as str]
            [crawler.core :as core]
            [crawler.utils :as utils]
            [misc.dates :as dates]
            [org.bovinegenius [exploding-fish :as uri]])
  (:use [clj-xpath.core :only [$x $x:node $x:node+ $x:text+]])
  (:import (org.htmlcleaner HtmlCleaner DomSerializer CleanerProperties)
           (org.w3c.dom Document)))
