{
if (_stax2Factory != null) {
/* have real stax2 factory; can create more optimal writer
* (most importantly: one that automatically closes the writer)
*/
Stax2FileResult res = new Stax2FileResult(f);
return (XMLStreamWriter2) _stax2Factory.createXMLStreamWriter(res);
}
/* No, just stax1 factory. Could use StreamResult; but some
* impls might not recognize it... immediate problem here:
* auto-closing won't work.