private Document getXML(Tile t, int numRetries, double tileSizeDivisorOnRetry) {

		String spec = getCoordinatesSpec(t);

		InputStream stream = null;

		try {

			/* check if file exist locally */
			String file = getCacheFileName(t);
			if(!new File(file).exists()) {
				new File(Constants.TMP_DIR).mkdir();
//				String baseURL = OVERPASS_API;
				String baseURL = OPENSTREETMAP_API_06;
				String url = baseURL + "map?bbox=" + spec;
				System.out.println(url);
				URL osm = new URL(url);
				HttpURLConnection connection = (HttpURLConnection) osm.openConnection();
				connection.addRequestProperty("Accept-Encoding", "compress, gzip");
				try {
					stream = connection.getInputStream();
				} catch (Exception e) {
					if(numRetries > 0) {
						Thread.sleep(2000);
						return getXML(t.centeredDivideBy(tileSizeDivisorOnRetry), 
								numRetries - 1, tileSizeDivisorOnRetry);
					} else {
						throw new RuntimeException("Unable to fetch (after multiple attempts): " + url);
					}
				}
				FileOutputStream fos = new FileOutputStream(file);
				IOUtils.copy(stream, fos);

				requestCount ++;
				if(requestCount % 10 == 0) {
					System.out.println("Made request #" + requestCount);
				}

			}

			return Util.readCompressedXmlFile(new File(file));
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}