private void loadFromFile(Collection collection, URI uri, String docName) throws XPathException { String path = uri.getPath(); File file = new File(path); if(!file.canRead()) throw new XPathException(getASTNode(), "Cannot read path: " + path);
private void loadFromFile(Collection collection, File file, String docName) throws XPathException {
	private void loadFromFile(Collection collection, URI uri, String docName) throws XPathException {		String path = uri.getPath();		File file = new File(path);		if(!file.canRead())			throw new XPathException(getASTNode(), "Cannot read path: " + path);		if(file.isFile()) {			try {				XMLResource resource =					(XMLResource) collection.createResource(docName, "XMLResource");				resource.setContent(file);				collection.storeResource(resource);			} catch (XMLDBException e) {				throw new XPathException(getASTNode(), "Could not store file " + path + ": " + e.getMessage(), e);			}		}	}