if (settings != null && selectedGenerator != null)
{
settings.beforeSerialization();
StringBuffer sb = new StringBuffer();
StringBufferOutputStream os = new StringBufferOutputStream(sb);
try
{
selectedGenerator.getXmlDriver().serialize(settings, os);
}
catch (XMLDriverException e)