Index: xmlsitemap/xmlsitemap.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- xmlsitemap/xmlsitemap.module	(date 1400734104000)
+++ xmlsitemap/xmlsitemap.module	(revision )
@@ -72,6 +72,7 @@
     'query_xmlsitemap_generate_alter',
     'query_xmlsitemap_link_bundle_access_alter',
     'form_xmlsitemap_sitemap_edit_form_alter',
+    'xmlsitemap_item_extend',
   );
 
   $hooks = array_combine($hooks, $hooks);
Index: xmlsitemap/xmlsitemap.xmlsitemap.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- xmlsitemap/xmlsitemap.xmlsitemap.inc	(date 1400734104000)
+++ xmlsitemap/xmlsitemap.xmlsitemap.inc	(revision )
@@ -92,15 +92,29 @@
   }
 
   /**
-   * Write an full XML sitemap element tag.
+   * Write a full XML sitemap element tag.
    *
-   * @param $name
+   * @param string $name
    *   The element name.
-   * @param $element
+   * @param array $element
    *   An array of the elements properties and values.
    */
   public function writeSitemapElement($name, array &$element) {
-    $this->writeElement($name, $element);
+    $this->startElement($name);
+    foreach ($element as $tag => $value) {
+      if (!is_array($value)) {
+        $this->writeElement($tag, $value);
+      }
+      elseif (isset($value['#name'])) {
+        $this->writeRaw(PHP_EOL);
+        $this->startElement($value['#name']);
+        foreach ($value['#attributes'] as $attr_key => $attr_value) {
+          $this->writeAttribute($attr_key, $attr_value);
+        }
+        $this->endElement();
+      }
+    }
+    $this->endElement();
     $this->writeRaw(PHP_EOL);
 
     // After a certain number of elements have been added, flush the buffer
Index: xmlsitemap/xmlsitemap.generate.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- xmlsitemap/xmlsitemap.generate.inc	(date 1400734104000)
+++ xmlsitemap/xmlsitemap.generate.inc	(revision )
@@ -188,10 +188,10 @@
       $link_count++;
     }
 
-    $element = array();
-    $element['loc'] = $link_url;
+    $url = array();
+    $url['loc'] = $link_url;
     if ($link['lastmod']) {
-      $element['lastmod'] = gmdate($lastmod_format, $link['lastmod']);
+      $url['lastmod'] = gmdate($lastmod_format, $link['lastmod']);
       // If the link has a lastmod value, update the changefreq so that links
       // with a short changefreq but updated two years ago show decay.
       // We use abs() here just incase items were created on this same cron run
@@ -199,15 +199,18 @@
       $link['changefreq'] = (abs(REQUEST_TIME - $link['lastmod']) + $link['changefreq']) / 2;
     }
     if ($link['changefreq']) {
-      $element['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']);
+      $url['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']);
     }
     if (isset($link['priority']) && $link['priority'] != 0.5) {
       // Don't output the priority value for links that have 0.5 priority. This
       // is the default 'assumed' value if priority is not included as per the
       // sitemaps.org specification.
-      $element['priority'] = number_format($link['priority'], 1);
+      $url['priority'] = number_format($link['priority'], 1);
     }
-    $writer->writeSitemapElement('url', $element);
+    $url = module_invoke_all('xmlsitemap_item_extend', $url, $writer);
+    if (count($url) > 0) {
+      $writer->writeSitemapElement('url', $url);
+    }
   }
 
   return $link_count;
