{
/* Need to ensure that the configuration object is not shared
* any more; otherwise later changes via factory could be
* visible half-way through output...
*/
WriterConfig cfg = mConfig.createNonShared();
XmlWriter xw;
boolean autoCloseOutput = requireAutoClose || mConfig.willAutoCloseOutput();
if (w == null) {