--- /dev/null	2013-08-12 15:26:37.000000000 +0100
+++ xmlsitemap.feeds.inc	2013-08-12 13:33:43.000000000 +0100
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Feeds mapping implementation for the XML sitemap module.
+ *
+ * @ingroup xmlsitemap
+ */
+
+/**
+ * Implements hook_feeds_processor_targets_alter().
+ */
+function xmlsitemap_feeds_processor_targets_alter(&$targets, $entity_type, $bundle) {
+  if (xmlsitemap_get_link_type_enabled_bundles($entity_type)) {
+    $info = xmlsitemap_link_bundle_load($entity_type, $bundle);
+    foreach ($info['info']['xmlsitemap'] as $name => $tag) {
+      $targets['xmlsitemap_' . $name] = array(
+        'name' => 'XML sitemap: ' . ucwords(check_plain($name)),
+        'callback' => 'xmlsitemap_feeds_set_target',
+        'description' => 'XML sitemap ' . check_plain($name),
+      );
+    }
+  }
+}
+
+/**
+ * Callback function to set value of a xmlsitemap tag.
+ */
+function xmlsitemap_feeds_set_target($source, $entity, $target, $value) {
+  // Don't do anything if we weren't given any data.
+  if (empty($value)) {
+    return;
+  }
+
+  // Strip the prefix that was added above.
+  $name = str_replace('xmlsitemap_', '', $target);
+
+  // Save the value.
+  $entity_type = $source->importer->processor->entityType();
+  $bundle = $entity->type;
+  xmlsitemap_link_bundle_settings_save($entity_type, $bundle, array($name => $value));
+}
+
