XMLResource res = new XMLResourceImpl(collection, doc, doc + "_" + s_id);
XMLResource res = new RemoteXMLResource(collection, doc, doc + "_" + s_id);
	public Resource nextResource() throws XMLDBException {        if(pos >= resources.size())            return null;        // node or value?        if(resources.elementAt(pos) instanceof Vector) {            // node            Vector v = (Vector)resources.elementAt(pos++);            String doc = (String)v.elementAt(0);            String s_id = (String)v.elementAt(1);                        Vector params = new Vector();            params.addElement(doc);            params.addElement(s_id);            params.addElement(new Integer(indentXML));            params.addElement(encoding);            try {                byte[] data = (byte[])collection.getClient().execute("retrieve", params);                XMLResource res = new XMLResourceImpl(collection, doc, doc + "_" + s_id);                res.setContent((Object)new String(data, encoding));                return res;            } catch(XmlRpcException xre) {                throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, xre.getMessage(), xre);            } catch(IOException ioe) {                throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ioe.getMessage(), ioe);            }        } else {            // value            XMLResource res = new XMLResourceImpl(collection, null, Integer.toString(pos));            res.setContent(resources.elementAt(pos++));            return res;        }    }