title: Using R to save API XML "response" to .xml file
body: <p>I'm playing with API data from www.onetonline.org. The output is in XML format, but the API does not produce a discrete XML file. Here's a sample call/response:</p>
  
  <p><code><code>&gt;</code> GET("<a href="http://services.onetcenter.org/ws/mnm/careers/17-2051.00/report" rel="nofollow">http://services.onetcenter.org/ws/mnm/careers/17-2051.00/report</a>",authenticate("[user]","[pass]"))</p>
  
  <p><code>Response [http://services.onetcenter.org/ws/mnm/careers/17-2051.00/report]</code>
  <code>Status: 200</code>
  <code>Content-type: application/vnd.org.onetcenter..srv.onet.services.ws.mnm.career.report+xml</code>
  <code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code>
  <code>&lt;report code="17-2051.00"&gt;</code>
  <code>&lt;career&gt;</code>
  <code>&lt;code&gt;17-2051.00&lt;/code&gt;</code>
  <code>&lt;title&gt;Civil Engineers&lt;/title&gt;</code>
  <code>&lt;tags bright_outlook="true" green="true" apprenticeship="false" /&gt;</code>
  <code>&lt;also_called&gt;</code>
  <code>&lt;title&gt;Civil Engineer&lt;/title&gt;</code>
  <code>&lt;title&gt;Engineer&lt;/title&gt;</code>
  <code>&lt;/career&gt;</code>
  <code>&lt;/report&gt;</code>
  </code></p>
  
  <p>I'd like to be able to parse this response into a table based on the XML tags, but I can't seem to find a way to create an XML file from this output (I would do it manually, but down the road I will need this function for many more API calls. If I pass this output to an object (e.g., <code>object &lt;- GET()</code>), the object class is <code>response</code>, and I'm not sure how to handle that. I'm not a novice at R, but I'm just beginning to dabble in http and API calls, so this facet of R is new to me. Also, I apologize if the formatting this post is improper (the code span didn't seem to be working in the preview).</p>