final Subject currentUser = broker.getSubject();
try {
broker.setSubject(pool.getSecurityManager().getSystemSubject());
txn = transact.beginTransaction();
txn.acquireLock(collection.getLock(), Lock.WRITE_LOCK);
final IndexInfo info = collection.validateXMLResource(txn, broker, uri, data);
final DocumentImpl doc = info.getDocument();
doc.getMetadata().setMimeType(MimeType.XML_TYPE.getName());
doc.getPermissions().setMode(Permission.DEFAULT_SYSTSEM_RESOURCE_PERM);
fullURI = getFullURI(broker.getBrokerPool(), doc.getURI());