I'd recommend using cURL. It supports HTTP/1.1, which is neccessary to reliably receive chunked data. The PHP core functions like file_get_contents
and the like do not support HTTP/1.1 do not support chunked data before PHP 5.3.0.
EDIT
Rephrased to clarify. Thank you, @troelskn.
EDIT
Example using cURL:
$rCURL = curl_init();
curl_setopt($rCURL, CURLOPT_URL, 'http://www.example.com/file_to_retrieve.xml');
curl_setopt($rCURL, CURLOPT_HEADER, 0);
curl_setopt($rCURL, CURLOPT_RETURNTRANSFER, 1);
$aData = curl_exec($rCURL);
curl_close($rCURL);
var_dump($aData);