serializer = (Serializer)selector.select(serializerName);
serializer.setOutputStream(oStream);
serializer.startDocument();
DOMStreamer streamer = new DOMStreamer(serializer);
streamer.stream(frag);
serializer.endDocument();
} catch (ComponentException e) {
throw new ProcessingException("Unable to lookup serializer.", e);
} finally {
if (oStream != null) {
oStream.flush();