File temp = File.createTempFile("exist", ".xml");
File temp = File.createTempFile("existDBS", ".xml");
	private Resource loadFromURI(Collection collection, URI uri, String docName, boolean binary) 	throws XPathException {		Resource resource;		if("file".equals(uri.getScheme())) {			String path = uri.getPath();            if(path == null)                throw new XPathException(getASTNode(), "Cannot read from URI: " + uri.toASCIIString());			File file = new File(path);			if(!file.canRead())				throw new XPathException(getASTNode(), "Cannot read path: " + path);			resource = loadFromFile(collection, file, docName, binary);		} else {			try {				File temp = File.createTempFile("exist", ".xml");				temp.deleteOnExit();				OutputStream os = new FileOutputStream(temp);				InputStream is = uri.toURL().openStream();				byte[] data = new byte[1024];				int read = 0;				while((read = is.read(data)) > -1) {					os.write(data, 0, read);				}				is.close();				resource = loadFromFile(collection, temp, docName, binary);				temp.delete();			} catch (MalformedURLException e) {				throw new XPathException(getASTNode(), "Malformed URL: " + uri.toString(), e);			} catch (IOException e) {				throw new XPathException(getASTNode(), "IOException while reading from URL: " +						uri.toString(), e);			}		}		return resource;	}