marshalName(index, ctx, internalPoolDatasource.getName());
ctx.endTag(index, INTERNAL_POOL_DATASOURCE_TAG_NAME);
} else if (type == DataSourceType.JNDI_DATASOURCE) {
JNDIDatasource jndiDatasource = (JNDIDatasource) dataSource;
ctx.startTag(index, JNDI_DATASOURCE_TAG_NAME);
writeTagsTextContent(ctx, JNDI_NAME_TAG_NAME,
jndiDatasource.getJndiName());
marshalName(index, ctx, jndiDatasource.getName());
ctx.endTag(index, JNDI_DATASOURCE_TAG_NAME);
} else {
throw new JiBXException(EXCEPTION_LOCALIZER
.format("invalid-datasource-type"));