I am not seeing 46 spaces as the XML you attached. The only issue I am experiencing using the simplexml_load_string function on the XML you attached is that there is no closing </feed> tag. Once I add that the XML is taken without an issue.
Does this code below produce an error for you?
$username = 'USERNAME' ;
$password = 'PASSWORD' ;
$apikey = 'APIKEY' ;
$requestLogin = $apikey . '%' . $username . ':' . $password ;
$ch = curl_init ( ) ;
curl_setopt ( $ch , CURLOPT_URL , 'https://api.constantcontact.com/ws/customers/' . $username . '/lists' ) ;
curl_setopt ( $ch , CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" ) ;
curl_setopt ( $ch , CURLOPT_HTTPAUTH , CURLAUTH_BASIC ) ;
curl_setopt ( $ch , CURLOPT_USERPWD , $requestLogin ) ;
curl_setopt ( $ch , CURLOPT_HEADER , 0 ) ;
curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , 1 ) ;
curl_setopt ( $ch , CURLOPT_HTTPHEADER , Array ( "Content-Type:application/atom+xml" , "accept:application/atom+xml" ) ) ;
curl_setopt ( $ch , CURLOPT_FAILONERROR , 1 ) ;
curl_setopt ( $ch , CURLOPT_SSL_VERIFYPEER , 0 ) ;
curl_setopt ( $ch , CURLOPT_CUSTOMREQUEST , 'GET' ) ;
$return = curl_exec ( $ch ) ;
$return = curl_getinfo ( $ch ) ;
$return = curl_error ( $ch ) ;
$parsedReturn = simplexml_load_string ( $return ) ;
print_r ( $parsedReturn ) ;
... View more