PHP error only when running from cronjob

Hi

I have a script, it is very simple:

// call the xml
$xml = file_get_contents(“http://twitter.com/statuses/user_timeline/” . $myTwitterID . “.xml” );

$directory = “xml”;
$xmlFileName = “twitts.xml”;
// cria o XML
try{
$fp = fopen($directory.’/’.$xmlFileName, ‘w’);
fwrite ($fp, stripslashes($xml) );
fclose($fp);
echo “<h1 align = ‘center’>Script Succeeded - XML file was generated!<h1>”;
echo “<p align=‘center’><a href=’”.$directory.’/’.$xmlFileName."’>click to open “.$xmlFileName.”</a><p />";
} catch (Exception $e) {
echo “<h1 align=‘center’>Script Error - File was <b>not</b> generated!</h1>”;
}

luckly it works when running mannualy but when it is runned from Cronjob I receive the following message in my email and log:

PHP Warning: fopen(xml/twitts.xml): failed to open stream: No such file or directory in /var/www/vhosts/pathtomyfile/call.php on line 37

PHP Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/pathtomyfile/call.php on line 38
PHP Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/pathtomyfile/call.php on line 39
<h1 align = ‘center’>Script Succeeded - XML file was generated!<h1><p align=‘center’><a href=‘xml/twitts.xml’>click to open twitts.xml</a><p />

Why is this happening only when I run with cronjob?

Thanks for any help