title: Using R to download and read zipped xml file
body: <p>Based on <a href="https://stackoverflow.com/a/3053883/891259">this</a> answer by Dirk Eddelbuettel I am trying to read an <code>xml</code> file from a <code>zip</code> archive for further processing. Apart from URL and filenames the only change to the code referenced is that I changed <code>read.table</code> to <code>xmlInternalTreeParse</code>.  </p>
  
  <pre><code>library(XML)
  temp &lt;- tempfile()
  download.file("http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?sort=1&amp;downfile=data%2Fnrg_105a.sdmx.zip",temp)
  doc &lt;- xmlInternalTreeParse(unz(temp, "nrg_105a.dsd.xml"))
  fileunlink(temp)
  closeAllConnections()
  </code></pre>
  
  <p>However, this returns the following error:</p>
  
  <pre><code>Error in file.exists(file) : invalid 'file' argument
  </code></pre>
  
  <p><code>traceback()</code>shows that this is a function call from within the parser. So temp seems to be an inappropriate reference in this context. Is there a way to make this work?</p>