FactoryConfigurationError, XMLStreamException,
TransformerException {
if (object == null) {
return;
}
Reader r = null;
try {
if (object instanceof XMLType) {
XMLType xml = (XMLType)object;
r = xml.getCharacterStream();
Type type = xml.getType();
convertReader(writer, eventWriter, r, type);
} else if (object instanceof Clob) {
Clob clob = (Clob)object;
r = clob.getCharacterStream();
convertReader(writer, eventWriter, r, Type.TEXT);
} else {
String val = convertToAtomicValue(object).getStringValue();
eventWriter.add(eventFactory.createCharacters(val));
}
} catch (SQLException e) {
throw new IOException(e);
} finally {
if (r != null) {
r.close();
}
}
//TODO: blob - with base64 encoding
}