Instead of doing
$path_out = 'output.xml';
$xw = new XMLWriter();
$xw->openURI($path_out);
Is it possible, using another method or any other way, to do something like:
$path_out = 'output.xml';
$fp = open($path_out, 'w');
$xw = new XMLWriter();
$xw->openURI($fp);