title: returning a XML response with CURL
body: <p>I am passing some parameters via HTTP POST to a webserver.</p>
  
  <p>I am getting a response, but ideally I want a full XML responses, whereas I seem to be only getting a concatenated string. I've tried SimpleXMLElement, but it doesn't seem to do anything, and it isn't returning any XML.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>$post_string = '&lt;?xml version="1.0" encoding="utf-16" ?&gt; 
  &lt;ChameleonIAPI&gt;
    &lt;Method&gt;TitleList&lt;/Method&gt; 
    &lt;APIKey&gt;D12E9CF3-F742-47FC-97CB-295F4488C2FA&lt;/APIKey&gt; 
    &lt;UserName&gt;David&lt;/UserName&gt;
    &lt;Filter&gt;
    &lt;/Filter&gt;
  &lt;/ChameleonIAPI&gt;';
  
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL,"https://jobs.chameleoni.com/PostXML/PostXml.aspx");
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS,
          "Action=postxml&amp;AuthKey=Guest&amp;AuthPassword=KgwLLm7TL6G6&amp;Xml=$post_string");
  
  // receive server response ...
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
  
  $server_output = curl_exec ($ch);
  
  echo $server_output." TEST &lt;br /&gt;";
  curl_close ($ch);
  
  $oXML = new SimpleXMLElement($server_output);
  
  foreach($oXML-&gt;entry as $oEntry){
    echo $oEntry-&gt;title . "\n";
  }
  </code></pre>
  
  <p>Here's the page which you can even test the POST and XML. </p>
  
  <p><a href="https://jobs.chameleoni.com/PostXML/PostingXML.html" rel="nofollow">https://jobs.chameleoni.com/PostXML/PostingXML.html</a></p>
  
  <p>My XML seems to be ok, as it works on the test page. I assume there is something wrong with my PHP, although I have no idea what that is! </p>
  
  <p>Any help would be lovely! </p>