collection.addDocument(broker, name, res.content);
newDoc = collection.addDocument(broker, name, res.content); res.document = newDoc;
	public void storeResource( Resource resource ) throws XMLDBException {			if( !(resource instanceof LocalXMLResource) )				throw new XMLDBException( ErrorCodes.NOT_IMPLEMENTED );			final LocalXMLResource res = (LocalXMLResource)resource;			final String name = res.getDocumentId();			LOG.debug( "storing document " + name );			DBBroker broker = null;			try {				broker = brokerPool.get(user);				//broker.flush();				Observer observer;				for(Iterator i = observers.iterator(); i.hasNext(); ) {					observer = (Observer)i.next();					collection.addObserver( observer );				}				if(res.file != null)					collection.addDocument(broker, name, 						new InputSource(res.file.getAbsolutePath()));				else if(res.root != null)					collection.addDocument(broker, name, res.root);				else					collection.addDocument(broker, name, res.content);				//broker.flush();			} catch ( Exception e ) {				e.printStackTrace();				throw new XMLDBException( ErrorCodes.VENDOR_ERROR,					e.getMessage(),					e );			} finally {				brokerPool.release( broker );			}			needsSync = true;		}