I have the following line in my script, but it fails to save the file in site/default/files folder. Is it possible I can replace
public://feedproducts.xml with an actual absolute path to the files directory?
$file = file_save_data($sxe->asXML(),"public://feedproducts.xml",FILE_EXISTS_REPLACE);
This script runs from the command line, and is inside a sub-directory inside the root. It also loads Drupal Bootstrap.