--- xmlsitemap.module.org	2008-05-19 08:21:18.000000000 +0200
+++ xmlsitemap.module	2008-11-28 14:32:01.000000000 +0100
@@ -331,6 +331,10 @@ function _xmlsitemap_output($chunk = NUL
   drupal_set_header('Content-type: text/xml; charset=utf-8');
   global $user;
   $dest = file_directory_path() .'/xmlsitemap';
+  if(module_exists('i18n')) {
+    global $locale; 
+    $dest .= '/'.$locale;
+  } 
   file_check_directory($dest, FILE_CREATE_DIRECTORY);
   if (isset($chunk)) {
     $dest .= "/sitemap$chunk.xml.gz";
@@ -389,6 +393,10 @@ function _xmlsitemap_update_cache($page 
   $current_user = $user;
   $user = user_load(array('uid' => 0));
   $path = file_directory_path() .'/xmlsitemap';
+  if(module_exists('i18n')) {
+    global $locale; 
+    $path .= "/".$locale;
+  }
   file_check_directory($path, FILE_CREATE_DIRECTORY);
   $node_count = db_result(db_query("SELECT COUNT(*) FROM {node}"));
   $dest = $path .'/sitemap.xml.gz';
@@ -759,9 +767,7 @@ function _xmlsitemap_get_path_alias($pat
   if (function_exists('custom_url_rewrite')) {
     $result = custom_url_rewrite('alias', $result, $path);
   }
-  if (module_exists('i18n')) {
-    i18n_get_lang_prefix($result, TRUE);
-  }
+
   return $result;
 }
 
