title: Error in R: no applicable method for 'xpathApply'
body: <p>I am trying to retrieve data in R from an oData source. This script worked, but after i updated some packages, the script required the xml2 package, which caused an error.</p>
  
  <pre><code>library('httr') # for sending http requests
  library("xml2") # for reading xml
  
  # log start of request
  log_message(paste("Requesting OData from:",url))
  
  # get the OData resource
  response &lt;- GET(url,authenticate(usr,pwd))
  
  # parse xml docucument
  responseContent &lt;- content(response,type="text/xml")
  
  # determine the names of the attributes
  xmlNames &lt;- xpathApply(responseContent,
                          '//ns:entry[1]//m:properties[1]/d:*',xmlName, 
                          namespaces = c(ns = "http://www.w3.org/2005/Atom",
                                         m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata",
                                         d="http://schemas.microsoft.com/ado/2007/08/dataservices"))
  </code></pre>
  
  <p>When determining the names of the attributes i get the following error. Does anyone know what this error message means and how I can solve it?</p>
  
  <blockquote>
    <p>Error in UseMethod("xpathApply") : 
      no applicable method for 'xpathApply' applied to an object of class "c('xml_document', 'xml_node')" </p>
  </blockquote>