res.setMatchTagging(matchTagging);
res.setMatchTagging(highlightMatches);
    public Resource getResource( long pos ) throws XMLDBException {        if ( pos < 0 || pos >= resources.size() )            return null;        Object r = resources.get( (int) pos );    	LocalXMLResource res = null;        if(r instanceof NodeProxy) {        	NodeProxy p = (NodeProxy)r;        	// the resource might belong to a different collection			// than the one by which this resource set has been			// generated: adjust if necessary.        	LocalCollection coll = collection;			if ( coll == null || p.doc.getCollection() == null ||				coll.collection.getId() != p.doc.getCollection().getId() ) {				coll =					new LocalCollection( user, brokerPool, null,						p.doc.getCollection() );			}			res = new LocalXMLResource( user, brokerPool, coll, p, indentXML );			res.setSAXDocEvents( saxDocumentEvents );			res.setEncoding( encoding );			res.setCreateContainerElements( createContainerElements );			res.setMatchTagging(matchTagging);        } else if(r instanceof String) {        	res = new LocalXMLResource( user, brokerPool, collection, null, -1);        	res.setContent( r );        } else if(r instanceof Resource)        	return (Resource)r;        return res;    }