private LocationProfile parseToProfile(Document document, String contextPath)
			throws CitysearchException {
		LocationProfile response = null;
		if (document != null && document.hasRootElement()) {
			Element locationElem = document.getRootElement().getChild(LOCATION);
			if (locationElem != null) {
				response = new LocationProfile();

				Element addressElem = locationElem.getChild(ADDRESS);
				if (addressElem != null) {
					response.setStreet(addressElem.getChildText(STREET));
					response.setCity(addressElem.getChildText(CITY));
					response.setState(addressElem.getChildText(STATE));
					response.setPostalCode(addressElem
							.getChildText(POSTAL_CODE));
				}

				Element contactInfo = locationElem.getChild(CONTACT_INFO);
				if (contactInfo != null) {
					response.setPhone(contactInfo.getChildText(PHONE));
				}

				Element urlElm = locationElem.getChild(URLS);
				if (urlElm != null) {
					response.setProfileUrl(urlElm.getChildText(PROFILE_URL));
					response.setSendToFriendUrl(urlElm
							.getChildText(SEND_TO_FRIEND_URL));
					response.setReviewsUrl(urlElm.getChildText(REVIEWS_URL));
					response.setWebsiteUrl(urlElm.getChildText(WEBSITE_URL));
					response.setMenuUrl(urlElm.getChildText(MENU_URL));
					response.setReservationUrl(urlElm
							.getChildText(RESERVATION_URL));
					response.setMapUrl(urlElm.getChildText(MAP_URL));
				}

				Element review = locationElem.getChild(REVIEWS);
				if (review != null) {
					response.setReviewCount(review
							.getChildText(TOTAL_USER_REVIEWS));
				}
				response.setImageUrl(getImage(locationElem.getChild(IMAGES),
						locationElem.getChild(CATEGORIES), contextPath));
			}
		}
		return response;
	}