}
	protected DocumentImpl getDocument(DBBroker broker, boolean lock) throws XMLDBException {	    DocumentImpl document = null;	    if(lock)            try {                document = parent.getCollection().getDocumentWithLock(broker, docId);            } catch (LockException e) {                throw new XMLDBException(ErrorCodes.PERMISSION_DENIED,                        "Failed to acquire lock on document " + docId);            }        else	        document = parent.getCollection().getDocument(broker, docId);	    if (document == null)	        throw new XMLDBException(ErrorCodes.INVALID_RESOURCE);	    return document;	}