title: Help w/ Retrieving XML via cURL
body: <p>I've run into trouble with the following php code:</p>
  
  <pre><code>&lt;?php
  $url = "http://api.ean.com/ean-services/rs/hotel/v3/list?    minorRev=1&amp;cid=55505&amp;apiKey=58x5kuujub8xbb5tzv3a2a8q&amp;locale=en_US&amp;currencyCode=USD&amp;xml=    &lt;HotelListRequest&gt;&lt;destinationString&gt;Seattle&lt;/destinationString&gt;    &lt;arrivalDate&gt;08/01/2011&lt;/arrivalDate&gt;&lt;departureDate&gt;08/03/2011&lt;/departureDate&gt;&lt;RoomGroup&gt;    &lt;Room&gt;&lt;numberOfAdults&gt;2&lt;/numberOfAdults&gt;&lt;/Room&gt;&lt;/RoomGroup&gt;    &lt;numberOfResults&gt;1&lt;/numberOfResults&gt;&lt;/HotelListRequest&gt;";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_TIMEOUT, 15);
  $contents = curl_exec ($ch);
  echo $contents;
  curl_close($ch);
  ?&gt;
  </code></pre>
  
  <p>The problem is that <i>$contents</i> contains markup that's not XML at all, so I can't parse it. It's confusing b/c entering the URL in my browser's address bar will display the XML document, but I can't seem to get a valid XML doc w/ this code.</p>
  
  <p>Here is a snippet of the string that gets returned:</p>
  
  <pre><code>{"HotelListResponse":{"customerSessionId":"0ABAA83D-4428-4913-0382-28FBB1901EFC","numberOfRoomsRequested":1,"moreResultsAvailable":true,"cacheKey":"-32344284:1303828fbb1:-1ef9","cacheLocation":"10.186.168.61:7305","HotelList":{"@size":"1","HotelSummary":{"@order":"0"
  </code></pre>
  
  <p>Could someone explain to me where I'm going wrong?</p>
  
  <p>Thx.</p>