Index: export/views-bonus-export-xml.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_bonus/export/views-bonus-export-xml.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 views-bonus-export-xml.tpl.php
--- export/views-bonus-export-xml.tpl.php	24 Jun 2009 17:27:53 -0000	1.2
+++ export/views-bonus-export-xml.tpl.php	19 Jul 2010 16:31:08 -0000
@@ -18,10 +18,8 @@ print '<?xml version="1.0" encoding="UTF
 <xml>
 <?php foreach ($themed_rows as $count => $row): ?>
   <node>
-<?php foreach ($row as $field => $content):
-    $label = $header[$field] ? $header[$field] : $field;
-?>
-    <<?php print $label; ?>><?php print $content; ?></<?php print $label; ?>>
+<?php foreach ($row as $field => $content):?>
+  <<?php print $header[$field]; ?>><?php print $content; ?></<?php print $header[$field]; ?>>
 <?php endforeach; ?>
   </node>
 <?php endforeach; ?>
Index: export/views_bonus_export.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_bonus/export/views_bonus_export.theme.inc,v
retrieving revision 1.8
diff -u -p -r1.8 views_bonus_export.theme.inc
--- export/views_bonus_export.theme.inc	16 Jun 2010 14:47:51 -0000	1.8
+++ export/views_bonus_export.theme.inc	19 Jul 2010 16:31:08 -0000
@@ -86,4 +86,19 @@ function template_preprocess_views_bonus
       $vars['themed_rows'][$num][$field] = $content;
     }
   }
+  foreach ($vars['header'] as $field => $label) {
+    if ($vars['options']['transform']) {
+      switch ($vars['options']['transform_type']) {
+        case 'dash':
+          $vars['header'][$field] = str_replace(' ', '-', $label);
+          break;
+        case 'underline':
+          $vars['header'][$field] = str_replace(' ', '_', $label);
+          break;
+        case 'pascal':
+          $vars['header'][$field] = str_replace(' ', '', ucwords($label));
+          break;
+      }
+    }
+  }
 }
Index: export/views_bonus_plugin_style_export_xml.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_bonus/export/views_bonus_plugin_style_export_xml.inc,v
retrieving revision 1.6
diff -u -p -r1.6 views_bonus_plugin_style_export_xml.inc
--- export/views_bonus_plugin_style_export_xml.inc	7 Jul 2009 07:59:40 -0000	1.6
+++ export/views_bonus_plugin_style_export_xml.inc	19 Jul 2010 16:31:08 -0000
@@ -23,5 +23,56 @@ class views_bonus_plugin_style_export_xm
     parent::init($view, $display, $options = NULL);
     $this->feed_image = drupal_get_path('module', 'views_bonus_export') . '/images/xml.png';
   }
-}
 
+  /**
+   * Set options fields and default values.
+   *
+   * @return
+   * An array of options information.
+   */
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['transform'] = array(
+      'default' => TRUE,
+      'translatable' => TRUE,
+    );
+
+    return $options;
+  }
+
+  /**
+   * Options form mini callback.
+   *
+   * @param $form
+   * Form array to add additional fields to.
+   * @param $form_state
+   * State of the form.
+   * @return
+   * None.
+   */
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+
+    $form['transform'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Transform spaces'),
+      '#default_value' => $this->options['transform'],
+      '#description' => t('Transform spaces to valid XML in field labels (spaces create invalid XML markup).'),
+    );
+    $form['transform_type'] = array(
+      '#type' => 'select',
+      '#title' => t('Transform type'),
+      '#default_value' => $this->options['transform_type'],
+      '#options' => array(
+        'dash' => t('Dash'),
+        'underline' => t('Underline'),
+        'pascal' => t('PascalCase'),
+      ),
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array(
+        'edit-style-options-transform' => array(TRUE),
+      ),
+    );
+  }
+}
