<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>support/faster-xml-simple/lib/faster_xml_simple.rb</filename>
    </added>
    <added>
      <filename>support/faster-xml-simple/test/regression_test.rb</filename>
    </added>
    <added>
      <filename>support/faster-xml-simple/test/test_helper.rb</filename>
    </added>
    <added>
      <filename>support/faster-xml-simple/test/xml_simple_comparison_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -78,7 +78,7 @@ class CampaignMonitor
    # Takes a CampaignMonitor API method name and set of parameters;
    # returns an XmlSimple object with the response
   def request(method, params)
-    response = XmlSimple.xml_in(http_get(request_url(method, params)), { 'keeproot' =&gt; false,
+    response = PARSER.xml_in(http_get(request_url(method, params)), { 'keeproot' =&gt; false,
       'forcearray' =&gt; %w[List Campaign Subscriber Client SubscriberOpen SubscriberUnsubscribe SubscriberClick SubscriberBounce],
       'noattr' =&gt; true })
     response.delete('d1p1:type')
@@ -217,4 +217,22 @@ class CampaignMonitor
       @list_id = list_id
     end
   end
-end
\ No newline at end of file
+end
+
+# If libxml is installed, we use the FasterXmlSimple library, that provides most of the functionality of XmlSimple
+# except it uses the xml/libxml library for xml parsing (rather than REXML). 
+# If libxml isn't installed, we just fall back on XmlSimple.
+
+PARSER =
+  begin
+    require 'xml/libxml'
+    # Older version of libxml aren't stable (bus error when requesting attributes that don't exist) so we
+    # have to use a version greater than '0.3.8.2'.
+    raise LoadError unless XML::Parser::VERSION &gt; '0.3.8.2'
+    $:.push(File.join(File.dirname(__FILE__), '..', 'support', 'faster-xml-simple', 'lib'))
+    require 'faster_xml_simple' 
+    p 'Using libxml-ruby'
+    FasterXmlSimple
+  rescue LoadError
+    XmlSimple
+  end</diff>
      <filename>lib/campaign_monitor.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f70bf9027c4003504ed96a1c425c6cc161f3bcfa</id>
    </parent>
  </parents>
  <author>
    <name>Andy Shen</name>
    <email>andy@shenie.info</email>
  </author>
  <url>http://github.com/patientslikeme/campaign_monitor/commit/867c977c287fbfb95cdf6906eda6365badd0b830</url>
  <id>867c977c287fbfb95cdf6906eda6365badd0b830</id>
  <committed-date>2008-08-23T16:41:21-07:00</committed-date>
  <authored-date>2008-08-23T16:41:21-07:00</authored-date>
  <message>use libxml-ruby if possible</message>
  <tree>c24ed74137384ca0d2c314ec707e6474d8f0c931</tree>
  <committer>
    <name>Andy Shen</name>
    <email>andy@shenie.info</email>
  </committer>
</commit>
