title: Downloading and reading XML SSDMX/ZIP file into R
body: <p>I am in very unfamiliar terrain with downloading this file set from the Federal Reserve's website (I was hoping for an API but it doesn't appear to exist).</p>
  <p>I am not sure what this Fed link format really is and how I would read the data into R.</p>
  <p>I tried solutions <a href="https://stackoverflow.com/questions/25005565/using-r-to-download-and-read-zipped-xml-file">here</a> and <a href="https://stackoverflow.com/questions/58872409/how-to-read-imf-xls-or-sdmx-data-from-url">here</a> but I get different errors and not sure where to go.  When I try something like <a href="https://stackoverflow.com/questions/25005565/using-r-to-download-and-read-zipped-xml-file">this solution</a>:</p>
  <pre><code>library(XML)
  
  tf &lt;- tempfile(tmpdir = tdir &lt;- tempdir())
  
  ## Download the zip file 
  download.file(&quot;https://www.federalreserve.gov/datadownload/Output.aspx?rel=Z1&amp;filetype=zip&quot;, tf)
  
  ## Unzip it in the temp folder
  xml_files &lt;- unzip(tf, exdir = tdir)
  
  ## Parse the first file
  doc &lt;- xmlInternalTreeParse(xml_files[1])
  </code></pre>
  <p>I get <code>Warning message: In unzip(tf, exdir = tdir) : zip file is corrupt</code></p>
  <p>So basically, I would like to be able to get the data without having to first go to the website, download the excel version, and then read the excel version into R.</p>
  <p>I am assuming there is a way to just reference this link <a href="https://www.federalreserve.gov/datadownload/Output.aspx?rel=Z1&amp;filetype=zip" rel="nofollow noreferrer">https://www.federalreserve.gov/datadownload/Output.aspx?rel=Z1&amp;filetype=zip</a> to read the data into R without the manual steps associated with first downloading in excel.</p>
  <p>The link for different download options for this data is here:  <a href="https://www.federalreserve.gov/datadownload/Choose.aspx?rel=Z1" rel="nofollow noreferrer">https://www.federalreserve.gov/datadownload/Choose.aspx?rel=Z1</a></p>
  <p>Thanks!</p>