Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin

Check folder permissions too.

Also See this post http://www.php.net/manual/en/function.fopen.php#105465 – suggests he had to change to absolute from relative to get around error message.

Set of debug suggestions here:
http://www.wrensoft.com/forum/showthread.php?t=786

1) folder permissions
2) upper/lowercase
3) abs/relative path
and finally it turned out to be an extra space somewhere,