}
} else if (source instanceof ExtendedSource){
ExtendedSource extendedSource = (ExtendedSource)source;
return unmarshal(null, extendedSource.createReader(xmlUnmarshaller));
} else {
UnmarshallerHandler handler = this.xmlUnmarshaller.getUnmarshallerHandler();
XMLTransformer transformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
SAXResult result = new SAXResult(handler);
transformer.transform(source, result);
return handler.getResult();
}
}finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}