LOG.debug("storing XML resource");
final InputSource inputsource = new InputSource(tmp.toURI().toASCIIString());
final IndexInfo info = collection.validateXMLResource(txn, broker, documentUri, inputsource);
final DocumentImpl doc = info.getDocument();
doc.getMetadata().setMimeType(contentType);
collection.release(Lock.READ_LOCK);
collectionLocked = false;
collection.store(txn, broker, info, inputsource, false);
LOG.debug("done");
} else {