public synchronized List<LocationGPSObject> processGeocoding(URL xmlFileUrl, RequestType type) {
		if (xmlFileUrl == null || type == null) {
			return new ArrayList<LocationGPSObject>();
		}

		/* Check for cached search results first. */
		if (this.cachedSearchResults.containsKey(xmlFileUrl.toString())) {
			return this.cachedSearchResults.get(xmlFileUrl.toString());
		}

		try {
			final String tagName = (type == RequestType.GEOCODING_REQUEST) ? "place" : "result";

			Document doc = this.docBuilder.parse(xmlFileUrl.toString()); 

			// normalize text representation
			doc.getDocumentElement().normalize();

			NodeList listOfPlaces = doc.getElementsByTagName(tagName);
			int nbrOfPlaces = listOfPlaces.getLength();
			List<LocationGPSObject> locations = new LinkedList<LocationGPSObject>();

			for (int index = 0; index < nbrOfPlaces; index++) {

				Node placeID = listOfPlaces.item(index);
				if (placeID.getNodeType() == Node.ELEMENT_NODE) {

					Element placeElement = (Element) placeID;
					String lat = placeElement.getAttribute("lat");
					String lon = placeElement.getAttribute("lon");
					String place = (type == RequestType.GEOCODING_REQUEST) ? 
							placeElement.getAttribute("display_name") : 
								placeElement.getTextContent();

							LocationGPSObject location = new LocationGPSObject(place);
							try {
								location.setLongitude(Double.parseDouble(lon));
								location.setLatitude(Double.parseDouble(lat));
								locations.add(location);
							} catch (NumberFormatException nf) { //don't add location
							}
				}
			}
			this.cachedSearchResults.put(xmlFileUrl.toString(), locations); //cache results
			return locations;

		} catch (SAXParseException error) {
			//create error-message
			StringBuilder sb = new StringBuilder("** Parsing error, line ");
			sb.append(error.getLineNumber());
			sb.append(", uri ");
			sb.append(error.getSystemId());
			sb.append(" ");
			sb.append(error.getMessage());
			Log.getLogger().log(Level.SEVERE, sb.toString(), error);

		} catch (SAXException e) {
			Exception x = e.getException();
			Log.getLogger().log(Level.SEVERE, e.getMessage(), (x == null) ? e : x);

		} catch (Throwable t) {
			Log.getLogger().log(Level.SEVERE, "Error" , t);
		} finally {
			Thread t = new Thread(this);
			t.start();
			try {
				t.join(); /*wait for sleep to finish before leaving the lock
				 *to this query-method*/
			} catch (InterruptedException ie) {
				Log.getLogger().log(Level.SEVERE, "Thread got interrupted.", ie);
			}
		}

		return null; 

	}