diff --git a/views/plugins/views_plugin_style_xml.inc b/views/plugins/views_plugin_style_xml.inc
index cb031bd..9e9f275 100644
--- a/views/plugins/views_plugin_style_xml.inc
+++ b/views/plugins/views_plugin_style_xml.inc
@@ -24,6 +24,7 @@ class views_plugin_style_xml extends views_plugin_style {
     $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
     $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
     $options['header'] = array('default' => NULL, 'translatable' => FALSE);
+    $options['footer'] = array('default' => NULL, 'translatable' => FALSE);
     $options['author'] = array('default' => $author_default, 'translatable' => FALSE);
     $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
     //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
@@ -97,6 +98,12 @@ class views_plugin_style_xml extends views_plugin_style {
       '#description' => t('You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)'),
       '#default_value' => $this->options['header'],
     );
+    $form['footer'] = array(
+      '#type' => 'textarea',
+      '#title' => t('XML document footer'),
+      '#description' => t('You can use this to place any additional lines you want at the end of the document.'),
+      '#default_value' => $this->options['footer'],
+    );
     $form['content_type'] = array(
       '#type' => 'radios',
       '#title'  => t('Content-Type'),
diff --git a/views/theme/views_views_xml_style.theme.inc b/views/theme/views_views_xml_style.theme.inc
index 26145ea..0259969 100644
--- a/views/theme/views_views_xml_style.theme.inc
+++ b/views/theme/views_views_xml_style.theme.inc
@@ -24,6 +24,7 @@ function template_preprocess_views_views_xml_style_raw(&$vars) {
   $plaintext_output = $options["plaintext_output"];
   $vars["content_type"] = ($options['content_type'] == 'default') ? 'text/xml' : $options['content_type'];
   $header = $options['header'];
+  $footer = $options['footer'];
   $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
   if ($header) {
     $xml .= $header . "\n";
@@ -85,6 +86,9 @@ function template_preprocess_views_views_xml_style_raw(&$vars) {
     $xml .= ($options['element_output'] == 'nested') ? "  </$end_top_child_object>\n": "/>\n";
   }
   $xml .= "</$endroot>\n";
+  if ($footer) {
+    $xml .= $footer . "\n";
+  }
   $vars["xml"] = $xml;
 }
 
