Q:

Importing XML with .php extension

I'm running into the following problem:
I have the following url link.php. 
It is a php file but it should be used as XML.  Now when I view the page source it shows me XML but I'm unable to import the data to my website. 
I've tried the following methods:
1.     $objDOM = new DOMDocument();
    $test = $objDOM->load("link.php");

2.     $nodes = simplexml_load_file("link.php");

3.     $xml=simplexml_load_string('link.php') or die("Error: Cannot create object");

But unfortunately all the above functions return a false and I think it has to do with the .php extension. 
Is it possible to import this file as XML? 
Thanks in advance! 

A:

Seems like I got it:
$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($ch, CURLOPT_URL, "link.php");
curl_setopt($ch, CURLOPT_USERPWD, 'username' . ':' . ' password');
$result = curl_exec($ch);
curl_close($ch);

$xml = simplexml_load_string($result);

This provides me the right data.  So like Quentin sayd, has nothing to do with extension but with authentification. 
Thanks for all responses!