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 15:14:26 -0000
@@ -19,7 +19,20 @@ print '<?xml version="1.0" encoding="UTF
 <?php foreach ($themed_rows as $count => $row): ?>
   <node>
 <?php foreach ($row as $field => $content):
-    $label = $header[$field] ? $header[$field] : $field;
+    switch ($options['transform_type']) :
+      case 'none':
+        $header[$field] ? $header[$field] : $field;
+        break;
+      case 'dash':
+        $label = $header[$field] ? str_replace(' ', '-', $header[$field]) : $field;
+        break;
+      case 'underline':
+        $label = $header[$field] ? str_replace(' ', '_', $header[$field]) : $field;
+        break;
+      case 'pascal':
+        $label = $header[$field] ? str_replace(' ', '', ucwords($header[$field])) : $field;
+        break;
+    endswitch;
 ?>
     <<?php print $label; ?>><?php print $content; ?></<?php print $label; ?>>
 <?php endforeach; ?>
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 15:14:26 -0000
@@ -23,5 +23,57 @@ 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(
+        'none' => t('None'),
+        'dash' => t('Dash'),
+        'underline' => t('Underline'),
+        'pascal' => t('PascalCase'),
+      ),
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array(
+        'edit-style-options-transform' => array(TRUE),
+      ),
+    );
+  }
+}
