@unlink("rssfeed.xml");
$handle = fopen("rssfeed.xml","w");
fwrite($handle, $payload);
fclose($handle);
Unlink deletes the file so that you can write cleanly, the @ is so that it won't print any errors.
$payload is the text you want to print into the file.