title: clojure.data.xml and parsing jdbc xml object
body: <p>I'm attempting to read xml (actual xml type) from a postgres database in clojure, however i'm not sure how to cast the <code>org.postgresql.jdbc4.Jdbc4SQLXML</code> object to something <code>clojure.data.xml</code> can make sense of.  </p>
  
  <p>When running <code>(xml/parse  ...)</code> on this object i'm getting the following error:</p>
  
  <pre><code>IllegalArgumentException No matching method found: createXMLStreamReader for class com.sun.xml.internal.stream.XMLInputFactoryImpl  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)
  </code></pre>
  
  <p>code below:</p>
  
  <pre><code>(ns clj-xml-dbms.core-test
    (:require [clojure.test :refer :all]
              [clojure.java.jdbc :as j]
              [clojure.data.xml :as xml]
              [clj-xml-dbms.core :refer :all])
    (:use [clojure.pprint ] ))
  
  (def db-spec {
               :classname "org.postgres.Driver"
               :subprotocol "postgres"
               :subname "//localhost:5432/mydb"
               :user "me"
               :password "secret"
               })
  
  ;; get the results of a query
  (def results
    (let [
          sql "select row_id, xml_col from stg.some_table limit 1 "
          db-connection (j/get-connection db-spec )
          statement (j/prepare-statement db-connection sql)
          query-results (j/query db-connection [statement]) ]
      (first query-results)))
  
  (pprint results)
  ;; {:row_id 18627,
  ;;  :xml_col #object[org.postgresql.jdbc4.Jdbc4SQLXML 0x6897f635 "org.postgresql.jdbc4.Jdbc4SQLXML@6897f635"]}
  
  ;; obviously clojure.data.xml/parse isn't going to work on that:
  (xml/parse (:xml_col results))
  
  ;; IllegalArgumentException No matching method found: createXMLStreamReader for class com.sun.xml.internal.stream.XMLInputFactoryImpl  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:80)
  </code></pre>
  
  <p>I guess i could cast the xml type in the db to a string, but there has to be something cleaner that that i would think.  Any tips appreciated, thanks. </p>