Index: modules/xmlsitemap/xmlsitemap.admin.inc
===================================================================
--- modules/xmlsitemap/xmlsitemap.admin.inc	(revision 1841)
+++ modules/xmlsitemap/xmlsitemap.admin.inc	(working copy)
@@ -53,6 +53,12 @@
     '#default_value' => variable_get('xmlsitemap_use_stylesheet', FALSE),
     '#description' => t('Specify a xml stylesheet for the sitemap?'),
   );
+  $form['general']['xmlsitemap_mobile'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Display as mobile sitemap'),
+    '#default_value' => variable_get('xmlsitemap_mobile', 0),
+    '#description' => t('Dispaly sitemap in mobile format'),
+  );
   $form['frontpage'] = array(
     '#type' => 'fieldset',
     '#title' => t('Front page'),
Index: modules/xmlsitemap/xmlsitemap.pages.inc
===================================================================
--- modules/xmlsitemap/xmlsitemap.pages.inc	(revision 1841)
+++ modules/xmlsitemap/xmlsitemap.pages.inc	(working copy)
@@ -96,6 +96,7 @@
   $headers = array("Content-type: text/xml; charset=utf-8");
   if (isset($chunk)) {
     if ($chunk < $link_count / $chunk_size) {
+      
       file_transfer("$parent_directory/xsm-$id-$chunk.xml", $headers);
     }
   }
@@ -166,14 +167,20 @@
  *  0).
  */
 function _xmlsitemap_create_cache_chunk($fp, $chunk_size, $chunk = 0) {
+  $is_mobile = variable_get('xmlsitemap_mobile', 0);
   fwrite($fp, '<?xml version="1.0" encoding="UTF-8"?>' . "\n");
   if ($xsl = _xmlsitemap_xsl()) {
     fwrite($fp, '<?xml-stylesheet type="text/xsl" href="' . $xsl . '" ?>' . "\n");
   }
   fwrite($fp, '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' . "\n");
-  fwrite($fp, '  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n");
-  fwrite($fp, '  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n");
-  fwrite($fp, '  http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . "\n");
+  if ($is_mobile) {
+    fwrite($fp, '  xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0">' . "\n");
+  }else{
+    fwrite($fp, '  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n");
+    fwrite($fp, '  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n");
+    fwrite($fp, '  http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . "\n");
+  }
   $start = $chunk * $chunk_size;
   $links = db_query_range("SELECT xsm.loc, xsm.module, xsm.type, xsm.id, xsm.sid, xsm.changed, xsm.changefreq, xsm.priority". xmlsitemap_sitemap_query() ."ORDER BY xsm.priority DESC, xsm.changed DESC, xsm.changefreq, xsm.loc", $start, $chunk_size);
   while ($link = db_fetch_object($links)) {
@@ -198,6 +205,9 @@
       $link->output .= "\t<lastmod>". gmdate(DATE_W3C, $link->changed) ."</lastmod>\n";
       $link->output .= "\t<changefreq>". xmlsitemap_sitemap_frequency($link->changefreq) ."</changefreq>\n";
       $link->output .= "\t<priority>". number_format($link->priority, 1) ."</priority>\n";
+      if ($is_mobile) {
+      	$link->output .= "\t<mobile:mobile/>\n";
+      }
       $link->output .= "</url>\n";
       fwrite($fp, $link->output);
     }
