processor.reset();
	public long updateResource(String resource, String xupdate)		throws XMLDBException {		long start = System.currentTimeMillis();		DocumentSet docs = new DocumentSet();		DBBroker broker = null;		org.exist.collections.Collection c = parent.getCollection();		try {			broker = pool.get(user);			if (resource == null) {				docs = c.allDocs(broker, docs, true, true);			} else {				DocumentImpl doc = c.getDocument(broker, resource);				docs.add(doc);			}			XUpdateProcessor processor = new XUpdateProcessor(broker, docs);			Modification modifications[] =				processor.parse(new InputSource(new StringReader(xupdate)));			long mods = 0;			for (int i = 0; i < modifications.length; i++) {				mods += modifications[i].process();				broker.flush();			}            //broker.sync();            LOG.debug("xupdate took " + (System.currentTimeMillis() - start) +            	"ms.");			return mods;		} catch (ParserConfigurationException e) {			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(),e);		} catch (IOException e) {			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(),e);		} catch (SAXException e) {			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(),e);		} catch (PermissionDeniedException e) {			throw new XMLDBException(				ErrorCodes.PERMISSION_DENIED,				e.getMessage());		} catch (EXistException e) {			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(),e);		} catch(Exception e) {			e.printStackTrace();			throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(),e);		} finally {			pool.release(broker);		}	}