Index: libgweather/weather.c
===================================================================
--- libgweather/weather.c	(revision 253)
+++ libgweather/weather.c	(working copy)
@@ -638,6 +638,24 @@ gboolean weather_info_is_valid (WeatherI
    return info->valid;
 }
 
+void weather_info_to_metric (WeatherInfo *info)
+{
+   g_return_if_fail(info != NULL);
+   info->temperature_unit = TEMP_UNIT_CENTIGRADE;
+   info->speed_unit = SPEED_UNIT_MS;
+   info->pressure_unit = PRESSURE_UNIT_HPA;
+   info->distance_unit = DISTANCE_UNIT_METERS;
+}
+
+void weather_info_to_imperial (WeatherInfo *info)
+{
+   g_return_if_fail(info != NULL);
+   info->temperature_unit = TEMP_UNIT_FAHRENHEIT;
+   info->speed_unit = SPEED_UNIT_MPH;
+   info->pressure_unit = PRESSURE_UNIT_INCH_HG;
+   info->distance_unit = DISTANCE_UNIT_MILES;
+}
+
 const WeatherLocation *weather_info_get_location (WeatherInfo *info)
 {
    g_return_val_if_fail(info != NULL, NULL);
@@ -707,6 +725,32 @@ const gchar *weather_info_get_conditions
     return weather_conditions_string(info->cond);
 }
 
+static gdouble temperature_value (gdouble far, TempUnit to_unit, gboolean *ok)
+{
+    if (far < -500.0) {
+	*ok = FALSE;
+	return 0.0;
+    }
+
+    *ok = TRUE;
+
+    switch (to_unit) {
+        case TEMP_UNIT_FAHRENHEIT:
+	    return far;
+        case TEMP_UNIT_CENTIGRADE:
+	    return TEMP_F_TO_C (far);
+        case TEMP_UNIT_KELVIN:
+	    return TEMP_F_TO_K (far);
+        case TEMP_UNIT_INVALID:
+        case TEMP_UNIT_DEFAULT:
+	default:
+	    *ok = FALSE;
+	    break;
+    }
+
+    return 0.0;
+}
+
 static const gchar *temperature_string (gfloat far, TempUnit to_unit, gboolean round)
 {
 	static gchar buf[100];
@@ -805,6 +849,36 @@ const gchar *weather_info_get_apparent (
     return temperature_string (apparent, info->temperature_unit, FALSE);
 }
 
+static gdouble speed_value (gdouble knots, SpeedUnit to_unit, gboolean *ok)
+{
+    if (knots < 0.0) {
+	*ok = FALSE;
+	return -1.0;
+    }
+
+    *ok = TRUE;
+
+    switch (to_unit) {
+        case SPEED_UNIT_KNOTS:
+            return knots;
+        case SPEED_UNIT_MPH:
+            return WINDSPEED_KNOTS_TO_MPH (knots);
+        case SPEED_UNIT_KPH:
+            return WINDSPEED_KNOTS_TO_KPH (knots);
+        case SPEED_UNIT_MS:
+            return WINDSPEED_KNOTS_TO_MS (knots);
+	case SPEED_UNIT_BFT:
+	    return WINDSPEED_KNOTS_TO_BFT (knots);
+        case SPEED_UNIT_INVALID:
+        case SPEED_UNIT_DEFAULT:
+        default:
+            *ok = FALSE;
+            break;
+    }
+
+    return -1.0;
+}
+
 static const gchar *windspeed_string (gfloat knots, SpeedUnit to_unit)
 {
     static gchar buf[100];
@@ -861,6 +935,38 @@ const gchar *weather_info_get_wind (Weat
     return buf;
 }
 
+static gdouble pressure_value (gdouble inHg, PressureUnit to_unit, gboolean *ok)
+{
+    if (inHg < 0.0) {
+	*ok = FALSE;
+	return -1.0;
+    }
+
+    *ok = TRUE;
+
+    switch (to_unit) {
+        case PRESSURE_UNIT_INCH_HG:
+            return inHg;
+        case PRESSURE_UNIT_MM_HG:
+            return PRESSURE_INCH_TO_MM (inHg);
+        case PRESSURE_UNIT_KPA:
+            return PRESSURE_INCH_TO_KPA (inHg);
+        case PRESSURE_UNIT_HPA:
+            return PRESSURE_INCH_TO_HPA (inHg);
+        case PRESSURE_UNIT_MB:
+            return PRESSURE_INCH_TO_MB (inHg);
+        case PRESSURE_UNIT_ATM:
+            return PRESSURE_INCH_TO_ATM (inHg);
+        case PRESSURE_UNIT_INVALID:
+        case PRESSURE_UNIT_DEFAULT:
+        default:
+	    *ok = FALSE;
+	    break;
+    }
+
+    return -1.0;
+}
+
 const gchar *weather_info_get_pressure (WeatherInfo *info)
 {
     static gchar buf[100];
@@ -906,6 +1012,33 @@ const gchar *weather_info_get_pressure (
     return buf;
 }
 
+static gdouble distance_value (gdouble miles, DistanceUnit to_unit, gboolean *ok)
+{
+    if (miles < 0.0) {
+	*ok = FALSE;
+	return -1.0;
+    }
+
+    *ok = TRUE;
+
+    switch (to_unit) {
+        case DISTANCE_UNIT_MILES:
+            return miles;
+        case DISTANCE_UNIT_KM:
+            return VISIBILITY_SM_TO_KM (miles);
+        case DISTANCE_UNIT_METERS:
+            return VISIBILITY_SM_TO_M (miles);
+            break;
+        case DISTANCE_UNIT_INVALID:
+        case DISTANCE_UNIT_DEFAULT:
+        default:
+	    *ok = FALSE;
+	    break;
+    }
+
+    return -1.0;
+}
+
 const gchar *weather_info_get_visibility (WeatherInfo *info)
 {
     static gchar buf[100];
@@ -1097,3 +1230,146 @@ weather_info_get_icon_name (WeatherInfo 
 
     return NULL;
 }
+
+/**
+ * @param info  Valid WeatherInfo instance.
+ * @param kind  Kind of the value to retreive.
+ * @param unit  Returned value will be in this unit.
+ * @param value Value set; it's valid only if returns TRUE. Should not be NULL.
+ * @return      Whether was the value set or not.
+ **/
+gboolean weather_info_get_temperature_raw (WeatherInfo *info, const gchar *kind, TempUnit unit, gdouble *value)
+{
+    gboolean res = FALSE;
+
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (kind != NULL, FALSE);
+    g_return_val_if_fail (value != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    if (g_ascii_strcasecmp (kind, "temp") == 0)
+	*value = temperature_value (info->temp, unit, &res);
+    else if (g_ascii_strcasecmp (kind, "dew") == 0)
+	*value = temperature_value (info->dew, unit, &res);
+    else if (g_ascii_strcasecmp (kind, "apparent") == 0)
+	*value = temperature_value (calc_apparent (info), unit, &res);
+
+    return res;
+}
+
+gboolean weather_info_get_datetime_raw (WeatherInfo *info, const gchar *kind, time_t *value)
+{
+    gboolean res = FALSE;
+
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (kind != NULL, FALSE);
+    g_return_val_if_fail (value != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    if (g_ascii_strcasecmp (kind, "update") == 0) {
+	*value = info->update;
+        res = info->update != 0;
+    } else if ((g_ascii_strcasecmp (kind, "sunrise") == 0 || g_ascii_strcasecmp (kind, "sunset") == 0) && info->sunValid) {
+	if (g_ascii_strcasecmp (kind, "sunrise") == 0)
+		*value = info->sunrise;
+	else
+		*value = info->sunset;
+	res = *value != 0;
+    }
+
+    return res;
+}
+
+gboolean weather_info_get_sky_raw (WeatherInfo *info, WeatherSky *sky)
+{
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (sky != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    if (info->sky < 0 || info->sky >= (sizeof (sky_str) / sizeof (char *)))
+	return FALSE;
+
+    *sky = info->sky;
+
+    return TRUE;
+}
+
+gboolean weather_info_get_conditions_raw (WeatherInfo *info, WeatherConditionPhenomenon *phenomenon, WeatherConditionQualifier *qualifier)
+{
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (phenomenon != NULL, FALSE);
+    g_return_val_if_fail (qualifier != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    if (!info->cond.significant)
+	return FALSE;
+
+    if (!(info->cond.phenomenon >= 0 &&
+	info->cond.phenomenon < 24 &&
+	info->cond.qualifier >= 0 &&
+	info->cond.qualifier < 13))
+        return FALSE;
+
+    *phenomenon = info->cond.phenomenon;
+    *qualifier = info->cond.qualifier;
+
+    return TRUE;
+}
+
+gboolean weather_info_get_wind_raw (WeatherInfo *info, SpeedUnit unit, gdouble *speed, WeatherWindDirection *direction)
+{
+    gboolean res = FALSE;
+
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (speed != NULL, FALSE);
+    g_return_val_if_fail (direction != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    if (info->windspeed < 0.0 || info->wind < 0 || info->wind >= (sizeof (wind_direction_str) / sizeof (char *)))
+        return FALSE;
+
+    *speed = speed_value (info->windspeed, unit, &res);
+    *direction = info->wind;
+
+    return res;
+}
+
+gboolean weather_info_get_pressure_raw (WeatherInfo *info, PressureUnit unit, gdouble *value)
+{
+    gboolean res = FALSE;
+
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (value != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    *value = pressure_value (info->pressure, unit, &res);
+
+    return res;
+}
+
+gboolean weather_info_get_visibility_raw (WeatherInfo *info, DistanceUnit unit, gdouble *value)
+{
+    gboolean res = FALSE;
+
+    g_return_val_if_fail (info != NULL, FALSE);
+    g_return_val_if_fail (value != NULL, FALSE);
+
+    if (!info->valid)
+	return FALSE;
+
+    *value = distance_value (info->visibility, unit, &res);
+
+    return res;
+}
Index: libgweather/weather-iwin.c
===================================================================
--- libgweather/weather-iwin.c	(revision 253)
+++ libgweather/weather-iwin.c	(working copy)
@@ -98,7 +98,10 @@ static void iwin_finish_read(GnomeVFSAsy
 	
     if (result == GNOME_VFS_ERROR_EOF)
     {
-        info->forecast = formatWeatherMsg(g_strdup (info->iwin_buffer));
+	if (info->forecast_type == FORECAST_XML)
+            info->forecast = g_strdup (info->iwin_buffer);
+	else
+            info->forecast = formatWeatherMsg(g_strdup (info->iwin_buffer));
     }
     else if (result != GNOME_VFS_OK) {
 	g_print("%s", gnome_vfs_result_to_string(result));
@@ -162,6 +165,25 @@ void iwin_start_open (WeatherInfo *info)
     loc = info->location;
     g_return_if_fail(loc != NULL);
 
+    if (info->forecast_type == FORECAST_XML) {
+	/* see the description here: http://www.weather.gov/forecasts/xml/ */
+	if (loc->latlon_valid) {
+		struct tm tm;
+		time_t now = time (NULL);
+
+		localtime_r (&now, &tm);
+
+		/* TODO: lat/lon should be in WGS84, which is different from that our. Thus this will return XML containing an error. */
+		url = g_strdup_printf ("http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php?&lat=%.02f&lon=%.02f&format=24+hourly&startDate=%04d-%02d-%02d&numDays=7",
+					loc->latitude, loc->longitude, tm.tm_year, tm.tm_mon, tm.tm_mday);
+
+		gnome_vfs_async_open(&info->iwin_handle, url, GNOME_VFS_OPEN_READ, 
+				     0, iwin_finish_open, info);
+		g_free(url);
+	}
+	return;
+    }
+
     if (loc->zone[0] == '-')
         return;
         
Index: libgweather/weather.h
===================================================================
--- libgweather/weather.h	(revision 253)
+++ libgweather/weather.h	(working copy)
@@ -63,7 +63,8 @@ gboolean		weather_location_equal	(const 
 
 typedef enum _WeatherForecastType {
     FORECAST_STATE,
-    FORECAST_ZONE
+    FORECAST_ZONE,
+    FORECAST_XML
 } WeatherForecastType;
 
 typedef enum {
@@ -164,6 +165,93 @@ gchar *			weather_info_get_weather_summa
 
 const gchar *		weather_info_get_icon_name	(WeatherInfo *info);
 gint			weather_info_next_sun_event	(WeatherInfo *info);
+
+/*
+ * Retrieving raw information
+ */
+
+enum _WeatherWindDirection {
+    WIND_VARIABLE,
+    WIND_N, WIND_NNE, WIND_NE, WIND_ENE,
+    WIND_E, WIND_ESE, WIND_SE, WIND_SSE,
+    WIND_S, WIND_SSW, WIND_SW, WIND_WSW,
+    WIND_W, WIND_WNW, WIND_NW, WIND_NNW
+};
+
+typedef enum _WeatherWindDirection WeatherWindDirection;
+
+enum _WeatherSky {
+    SKY_INVALID = -1,
+    SKY_CLEAR,
+    SKY_BROKEN,
+    SKY_SCATTERED,
+    SKY_FEW,
+    SKY_OVERCAST
+};
+
+typedef enum _WeatherSky WeatherSky;
+
+enum _WeatherConditionPhenomenon {
+   PHENOMENON_NONE,
+
+   PHENOMENON_DRIZZLE,
+   PHENOMENON_RAIN,
+   PHENOMENON_SNOW,
+   PHENOMENON_SNOW_GRAINS,
+   PHENOMENON_ICE_CRYSTALS,
+   PHENOMENON_ICE_PELLETS,
+   PHENOMENON_HAIL,
+   PHENOMENON_SMALL_HAIL,
+   PHENOMENON_UNKNOWN_PRECIPITATION,
+
+   PHENOMENON_MIST,
+   PHENOMENON_FOG,
+   PHENOMENON_SMOKE,
+   PHENOMENON_VOLCANIC_ASH,
+   PHENOMENON_SAND,
+   PHENOMENON_HAZE,
+   PHENOMENON_SPRAY,
+   PHENOMENON_DUST,
+
+   PHENOMENON_SQUALL,
+   PHENOMENON_SANDSTORM,
+   PHENOMENON_DUSTSTORM,
+   PHENOMENON_FUNNEL_CLOUD,
+   PHENOMENON_TORNADO,
+   PHENOMENON_DUST_WHIRLS
+};
+
+typedef enum _WeatherConditionPhenomenon WeatherConditionPhenomenon;
+
+enum _WeatherConditionQualifier {
+   QUALIFIER_NONE,
+
+   QUALIFIER_VICINITY,
+
+   QUALIFIER_LIGHT,
+   QUALIFIER_MODERATE,
+   QUALIFIER_HEAVY,
+   QUALIFIER_SHALLOW,
+   QUALIFIER_PATCHES,
+   QUALIFIER_PARTIAL,
+   QUALIFIER_THUNDERSTORM,
+   QUALIFIER_BLOWING,
+   QUALIFIER_SHOWERS,
+   QUALIFIER_DRIFTING,
+   QUALIFIER_FREEZING
+};
+
+typedef enum _WeatherConditionQualifier WeatherConditionQualifier;
+
+gboolean		weather_info_get_temperature_raw(WeatherInfo *info, const gchar *kind, TempUnit     unit, gdouble *value);
+gboolean		weather_info_get_datetime_raw	(WeatherInfo *info, const gchar *kind, time_t *value);
+
+gboolean		weather_info_get_sky_raw	(WeatherInfo *info, WeatherSky *sky);
+gboolean		weather_info_get_conditions_raw	(WeatherInfo *info, WeatherConditionPhenomenon *phenomenon, WeatherConditionQualifier *qualifier);
+gboolean		weather_info_get_wind_raw	(WeatherInfo *info, SpeedUnit    unit, gdouble *speed, WeatherWindDirection *direction);
+gboolean		weather_info_get_pressure_raw	(WeatherInfo *info, PressureUnit unit, gdouble *value);
+gboolean		weather_info_get_visibility_raw	(WeatherInfo *info, DistanceUnit unit, gdouble *value);
+
 G_END_DECLS
 
 #endif /* __WEATHER_H_ */
Index: libgweather/weather-priv.h
===================================================================
--- libgweather/weather-priv.h	(revision 253)
+++ libgweather/weather-priv.h	(working copy)
@@ -20,79 +20,6 @@
  * Weather information.
  */
 
-enum _WeatherWindDirection {
-    WIND_VARIABLE,
-    WIND_N, WIND_NNE, WIND_NE, WIND_ENE,
-    WIND_E, WIND_ESE, WIND_SE, WIND_SSE,
-    WIND_S, WIND_SSW, WIND_SW, WIND_WSW,
-    WIND_W, WIND_WNW, WIND_NW, WIND_NNW
-};
-
-typedef enum _WeatherWindDirection WeatherWindDirection;
-
-enum _WeatherSky {
-    SKY_INVALID = -1,
-    SKY_CLEAR,
-    SKY_BROKEN,
-    SKY_SCATTERED,
-    SKY_FEW,
-    SKY_OVERCAST
-};
-
-typedef enum _WeatherSky WeatherSky;
-
-enum _WeatherConditionPhenomenon {
-   PHENOMENON_NONE,
-
-   PHENOMENON_DRIZZLE,
-   PHENOMENON_RAIN,
-   PHENOMENON_SNOW,
-   PHENOMENON_SNOW_GRAINS,
-   PHENOMENON_ICE_CRYSTALS,
-   PHENOMENON_ICE_PELLETS,
-   PHENOMENON_HAIL,
-   PHENOMENON_SMALL_HAIL,
-   PHENOMENON_UNKNOWN_PRECIPITATION,
-
-   PHENOMENON_MIST,
-   PHENOMENON_FOG,
-   PHENOMENON_SMOKE,
-   PHENOMENON_VOLCANIC_ASH,
-   PHENOMENON_SAND,
-   PHENOMENON_HAZE,
-   PHENOMENON_SPRAY,
-   PHENOMENON_DUST,
-
-   PHENOMENON_SQUALL,
-   PHENOMENON_SANDSTORM,
-   PHENOMENON_DUSTSTORM,
-   PHENOMENON_FUNNEL_CLOUD,
-   PHENOMENON_TORNADO,
-   PHENOMENON_DUST_WHIRLS
-};
-
-typedef enum _WeatherConditionPhenomenon WeatherConditionPhenomenon;
-
-enum _WeatherConditionQualifier {
-   QUALIFIER_NONE,
-
-   QUALIFIER_VICINITY,
-
-   QUALIFIER_LIGHT,
-   QUALIFIER_MODERATE,
-   QUALIFIER_HEAVY,
-   QUALIFIER_SHALLOW,
-   QUALIFIER_PATCHES,
-   QUALIFIER_PARTIAL,
-   QUALIFIER_THUNDERSTORM,
-   QUALIFIER_BLOWING,
-   QUALIFIER_SHOWERS,
-   QUALIFIER_DRIFTING,
-   QUALIFIER_FREEZING
-};
-
-typedef enum _WeatherConditionQualifier WeatherConditionQualifier;
-
 struct _WeatherConditions {
     gboolean significant;
     WeatherConditionPhenomenon phenomenon;
