doc.setMimeType("text/xml");
doc.getMetadata().setMimeType(MimeType.XML_TYPE.getName());
	private synchronized void save(DBBroker broker, Txn transaction) throws EXistException {		LOG.debug("storing acl file");		StringBuffer buf = new StringBuffer();		buf.append("<auth>");		// save groups		buf.append("<groups last-id=\"");		buf.append(Integer.toString(nextGroupId));		buf.append("\">");		for (Iterator i = groups.valueIterator(); i.hasNext();)			buf.append(((Group) i.next()).toString());		buf.append("</groups>");		//save users		buf.append("<users last-id=\"");		buf.append(Integer.toString(nextUserId));		buf.append("\">");		for (Iterator i = users.valueIterator(); i.hasNext();)			buf.append(((User) i.next()).toString());		buf.append("</users>");		buf.append("</auth>");        		// store users.xml		broker.flush();		broker.sync(Sync.MAJOR_SYNC);		try {			broker.setUser(getUser(DBA_USER));			Collection sysCollection = broker.getCollection(DBBroker.SYSTEM_COLLECTION);            String data = buf.toString();            IndexInfo info = sysCollection.validate(transaction, broker, ACL_FILE, data);            DocumentImpl doc = info.getDocument();            doc.setMimeType("text/xml");            sysCollection.store(transaction, broker, info, data, false);			doc.setPermissions(0770);			broker.saveCollection(transaction, doc.getCollection());		} catch (SAXException e) {			throw new EXistException(e.getMessage());		} catch (PermissionDeniedException e) {			throw new EXistException(e.getMessage());		} catch (TriggerException e) {			throw new EXistException(e.getMessage());		} catch (LockException e) {			throw new EXistException(e.getMessage());		}		broker.flush();		broker.sync(Sync.MAJOR_SYNC);	}