title: Parsing XML with Nokogiri
body: <p>I can not figure out how to parse the "author" and "fact" tags out of the following XML.  If the formatting looks strange <a href="http://www.librarything.com/services/rest/1.1/?method=librarything.ck.getwork&amp;isbn=0590353403&amp;apikey=d231aa37c9b4f5d304a60a3d0ad1dad4" rel="nofollow">here is a link</a> to the XML doc.</p>
  
  <pre><code>&lt;response stat="ok"&gt;
  −&lt;ltml version="1.1"&gt;
     −&lt;item id="5403381" type="work"&gt;
        &lt;author id="21" authorcode="rowlingjk"&gt;J. K. Rowling&lt;/author&gt;
        &lt;url&gt;http://www.librarything.com/work/5403381&lt;/url&gt;
       −&lt;commonknowledge&gt;
       −&lt;fieldList&gt;
       −&lt;field type="42" name="alternativetitles" displayName="Alternate titles"&gt;
       −&lt;versionList&gt;
       −&lt;version id="3413291" archived="0" lang="eng"&gt;
           &lt;date timestamp="1298398701"&gt;Tue, 22 Feb 2011 13:18:21 -0500&lt;/date&gt;
           −&lt;person id="18138"&gt;
               &lt;name&gt;ablachly&lt;/name&gt;
               &lt;url&gt;http://www.librarything.com/profile/ablachly&lt;/url&gt;
            &lt;/person&gt;
           −&lt;factList&gt;
                &lt;fact&gt;Harry Potter and the Sorcerer's Stone &lt;/fact&gt;
             &lt;/factList&gt;
                &lt;/version&gt;
         &lt;/versionList&gt;
        &lt;/field&gt;
  </code></pre>
  
  <p>So far I have tried this code to get the author but it does not work:</p>
  
  <pre><code>@xml_doc = Nokogiri::XML(open("http://www.librarything.com/services/rest/1.1/?method=librarything.ck.getwork&amp;isbn=0590353403&amp;apikey=d231aa37c9b4f5d304a60a3d0ad1dad4"))
  
  @xml_doc.xpath('//response').each do |n|
      @author = n      
  end
  </code></pre>