}
final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
final Txn txn = txnManager.beginTransaction();
DocumentImpl resource = null;
try {
if ("XMLResource".equals(type)) {
// store as xml resource
final IndexInfo info = currentCollection.validateXMLResource(txn, broker, docUri, is);
resource = info.getDocument();
final DocumentMetadata meta = resource.getMetadata();
meta.setMimeType(mimetype);
meta.setCreated(date_created.getTime());
meta.setLastModified(date_modified.getTime());
if((publicid != null) || (systemid != null)) {