throws JiBXException {
MarshallingContext ctx = (MarshallingContext) context;
DatasourceConfiguration dataSource = (DatasourceConfiguration) arg0;
DataSourceType type = dataSource.getType();
if (type == DataSourceType.JDBC_DATASOURCE) {
JDBCDatasource jdbcDatasource = (JDBCDatasource) dataSource;
ctx.startTag(index, JDBC_DATASOURCE_TAG_NAME);
writeTagsTextContent(ctx, DRIVER_CLASS_TAG_NAME,
jdbcDatasource.getDriverClass());
writeTagsTextContent(ctx, CONNECTION_STRING_TAG_NAME,
jdbcDatasource.getConnectionString());
marshalName(index, ctx, jdbcDatasource.getName());
ctx.endTag(index, JDBC_DATASOURCE_TAG_NAME);
} else if (type == DataSourceType.INTERNAL_POOL_DATASOURCE) {
InternalPoolDatasource internalPoolDatasource =
(InternalPoolDatasource) dataSource;