XMLResource res = (XMLResource) collection.getResource(pattern);
Resource res = collection.getResource(pattern);
	private final void remove(String pattern) throws XMLDBException {		Collection collection = current;		if (pattern.startsWith("/")) {			System.err.println("path pattern should be relative to current collection");			return;		}		Resource resources[];		XMLResource res = (XMLResource) collection.getResource(pattern);		if (res == null)			resources = CollectionScanner.scan(collection, "", pattern);		else {			resources = new Resource[1];			resources[0] = res;		}		Collection parent;		for (int i = 0; i < resources.length; i++) {			message("removing document " + ((XMLResource) resources[i]).getDocumentId() + " ...");			parent = resources[i].getParentCollection();			parent.removeResource(resources[i]);			messageln("done.");		}	}