diff --git a/tests/base.test b/tests/base.test
index 54464cc..ec9387e 100644
--- a/tests/base.test
+++ b/tests/base.test
@@ -332,6 +332,9 @@ abstract class ViewsDataExportSimpleExportTest extends ViewsDataExportBaseTest {
 
   protected $vde_export_type;
 
+  /**
+   * Tests the non-batched export functionality for this style.
+   */
   public function testNonBatchedExport() {
     $path = 'vde_test/' . $this->randomName();
     list($view, $expected) = $this->getExportView($path);
@@ -346,6 +349,9 @@ abstract class ViewsDataExportSimpleExportTest extends ViewsDataExportBaseTest {
     $this->assertExportEqual($result, $expected, 'Non batched ' . $this->vde_export_type . ' export matched expected output.');
   }
 
+  /**
+   * Tests the batched export functionality for this style.
+   */
   public function testBatchedExport() {
     $path = 'vde_test/' . $this->randomName();
     list($view, $expected) = $this->getExportView($path);
@@ -360,6 +366,15 @@ abstract class ViewsDataExportSimpleExportTest extends ViewsDataExportBaseTest {
     $this->assertBatchedExportEqual($path, $expected, 'Batched ' . $this->vde_export_type . ' export matched expected output.');
   }
 
+  /**
+   * Get a very basic view and expected output for this style.
+   *
+   * @return
+   *   An array containing two elements:
+   *   - A View object, for the export.
+   *   - The expected out from that view, if is was executed without further
+   *     changes.
+   */
   abstract protected function getExportView($path = 'vde_test');
 
   /**
@@ -418,4 +433,75 @@ abstract class ViewsDataExportSimpleExportTest extends ViewsDataExportBaseTest {
 
     return $view;
   }
-}
\ No newline at end of file
+
+  /**
+   * Get a view that's our basic view, but with hide if empty/0 support.
+   *
+   * We add this to the 'age' field.
+   */
+  protected function getHideIfEmptyExportView() {
+    $view = $this->getBasicExportView();
+
+    $display = $view->display['default']->handler;
+
+    $display->override_option('fields', array(
+      'id' => array(
+        'id' => 'id',
+        'table' => 'views_test',
+        'field' => 'id',
+        'relationship' => 'none',
+      ),
+      'name' => array(
+        'id' => 'name',
+        'table' => 'views_test',
+        'field' => 'name',
+        'relationship' => 'none',
+        // Hide their name if its empty.
+        'hide_empty' => TRUE,
+        // But we don't hide it if it's: 0.
+        'empty_zero' => FALSE,
+      ),
+      'age' => array(
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'relationship' => 'none',
+        // Hide their age if it's empty.
+        'hide_empty' => TRUE,
+        'empty_zero' => TRUE,
+      ),
+    ));
+
+    return $view;
+  }
+
+  /**
+   * Execute a given view very simply.
+   *
+   * This will take a view, and add a display plugin of the correct export type,
+   * and then run it and compare it with the expected output.
+   */
+  protected function executeAndCompareGivenView(view $view, $expected, $message = '') {
+    $path = 'vde_test/' . $this->randomName();
+
+    $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
+    $display->override_option('style_plugin', $this->getStylePluginName());
+    $display->override_option('path', $path);
+
+    // Save this view so we can hit the path.
+    $view->save();
+
+    // Ensure that the menu router system is rebuilt on the next page load.
+    variable_set('menu_rebuild_needed', TRUE);
+
+    $this->drupalGet($path);
+    $result = $this->drupalGetContent();
+
+    $this->assertExportEqual($result, $expected, $message);
+  }
+
+  /**
+   * Return the name of the style plugin represented by this test.
+   */
+  abstract protected function getStylePluginName();
+}
diff --git a/tests/csv_export.test b/tests/csv_export.test
index 70c96ed..08238da 100644
--- a/tests/csv_export.test
+++ b/tests/csv_export.test
@@ -14,12 +14,16 @@ class CSVExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
 
   protected $vde_export_type = 'CSV';
 
+  protected function getStylePluginName() {
+    return 'views_data_export_csv';
+  }
+
   protected function getExportView($path = 'vde_test') {
     // Create the basic view.
     $view = $this->getBasicExportView();
 
     $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
-    $display->override_option('style_plugin', 'views_data_export_csv');
+    $display->override_option('style_plugin', $this->getStylePluginName());
     $display->override_option('path', $path);
 
     $expected = '"ID","Name","Age"
@@ -32,4 +36,4 @@ class CSVExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
     return array(&$view, $expected);
   }
 
-}
\ No newline at end of file
+}
diff --git a/tests/doc_export.test b/tests/doc_export.test
index 72e24c3..deed57d 100644
--- a/tests/doc_export.test
+++ b/tests/doc_export.test
@@ -14,12 +14,16 @@ class DOCExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
 
   protected $vde_export_type = 'DOC';
 
+  protected function getStylePluginName() {
+    return 'views_data_export_doc';
+  }
+
   protected function getExportView($path = 'vde_test') {
     // Create the basic view.
     $view = $this->getBasicExportView();
 
     $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
-    $display->override_option('style_plugin', 'views_data_export_doc');
+    $display->override_option('style_plugin', $this->getStylePluginName());
     $display->override_option('path', $path);
 
     $expected = '<html>
diff --git a/tests/txt_export.test b/tests/txt_export.test
index 35c7f00..51354ce 100644
--- a/tests/txt_export.test
+++ b/tests/txt_export.test
@@ -14,12 +14,16 @@ class TXTExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
 
   protected $vde_export_type = 'TXT';
 
+  protected function getStylePluginName() {
+    return 'views_data_export_txt';
+  }
+
   protected function getExportView($path = 'vde_test') {
     // Create the basic view.
     $view = $this->getBasicExportView();
 
     $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
-    $display->override_option('style_plugin', 'views_data_export_txt');
+    $display->override_option('style_plugin', $this->getStylePluginName());
     $display->override_option('path', $path);
 
     $expected = '[ID]
@@ -80,4 +84,81 @@ Meredith
     return array(&$view, $expected);
   }
 
+  /**
+   * Test to check if empty fields are correctly hidden.
+   */
+  protected function testHideEmptySupport() {
+    $view = $this->getHideIfEmptyExportView();
+
+    // We need to ensure that the test fields are actually empty/0.
+    db_update('views_test')
+      ->fields(array('age' => 0,))
+      ->condition('name', 'Paul')
+      ->execute();
+
+    db_update('views_test')
+      ->fields(array('name' => '',))
+      ->condition('name', 'George')
+      ->execute();
+
+    db_update('views_test')
+      ->fields(array('name' => 0,))
+      ->condition('name', 'John')
+      ->execute();
+
+    $expected = '[ID]
+
+1
+[Name]
+
+0
+[Age]
+
+25
+----------------------------------------
+
+[ID]
+
+2
+[Age]
+
+27
+----------------------------------------
+
+[ID]
+
+3
+[Name]
+
+Ringo
+[Age]
+
+28
+----------------------------------------
+
+[ID]
+
+4
+[Name]
+
+Paul
+----------------------------------------
+
+[ID]
+
+5
+[Name]
+
+Meredith
+[Age]
+
+30
+----------------------------------------';
+
+  $message = 'Hide if empty support for ' . $this->vde_export_type . ' export matched expected output.';
+
+  $this->executeAndCompareGivenView($view, $expected, $message);
+
+  }
+
 }
diff --git a/tests/xls_export.test b/tests/xls_export.test
index 4146030..ae47de7 100644
--- a/tests/xls_export.test
+++ b/tests/xls_export.test
@@ -14,12 +14,16 @@ class XLSExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
 
   protected $vde_export_type = 'XLS';
 
+  protected function getStylePluginName() {
+    return 'views_data_export_xls';
+  }
+
   protected function getExportView($path = 'vde_test') {
     // Create the basic view.
     $view = $this->getBasicExportView();
 
     $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
-    $display->override_option('style_plugin', 'views_data_export_xls');
+    $display->override_option('style_plugin', $this->getStylePluginName());
     $display->override_option('path', $path);
 
     $expected = '<html>
diff --git a/tests/xml_export.test b/tests/xml_export.test
index a1dc350..423253b 100644
--- a/tests/xml_export.test
+++ b/tests/xml_export.test
@@ -14,6 +14,10 @@ class XMLExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
 
   protected $vde_export_type = 'XML';
 
+  protected function getStylePluginName() {
+    return 'views_data_export_xml';
+  }
+
   protected function getExportView($path = 'vde_test') {
     // Create the basic view.
     $view = $this->getBasicExportView();
@@ -54,4 +58,59 @@ class XMLExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
     return array(&$view, $expected);
   }
 
+  /**
+   * Test to check if empty fields are correctly hidden.
+   */
+  protected function testHideEmptySupport() {
+    $view = $this->getHideIfEmptyExportView();
+
+    // We need to ensure that the test fields are actually empty/0.
+    db_update('views_test')
+      ->fields(array('age' => 0,))
+      ->condition('name', 'Paul')
+      ->execute();
+
+    db_update('views_test')
+      ->fields(array('name' => '',))
+      ->condition('name', 'George')
+      ->execute();
+
+    db_update('views_test')
+      ->fields(array('name' => 0,))
+      ->condition('name', 'John')
+      ->execute();
+
+    $expected = '<?xml version="1.0" encoding="UTF-8" ?>
+<views_tests>
+  <views_test>
+    <ID>1</ID>
+    <Name>0</Name>
+    <Age>25</Age>
+  </views_test>
+  <views_test>
+    <ID>2</ID>
+    <Age>27</Age>
+  </views_test>
+  <views_test>
+    <ID>3</ID>
+    <Name>Ringo</Name>
+    <Age>28</Age>
+  </views_test>
+  <views_test>
+    <ID>4</ID>
+    <Name>Paul</Name>
+  </views_test>
+  <views_test>
+    <ID>5</ID>
+    <Name>Meredith</Name>
+    <Age>30</Age>
+  </views_test>
+</views_tests>';
+
+  $message = 'Hide if empty support for ' . $this->vde_export_type . ' export matched expected output.';
+
+  $this->executeAndCompareGivenView($view, $expected, $message);
+
+  }
+
 }
diff --git a/theme/views_data_export.theme.inc b/theme/views_data_export.theme.inc
index 057da8f..3f0e856 100644
--- a/theme/views_data_export.theme.inc
+++ b/theme/views_data_export.theme.inc
@@ -242,6 +242,8 @@ function template_preprocess_views_data_export_csv(&$vars) {
  */
 function template_preprocess_views_data_export_txt_body(&$vars) {
   _views_data_export_header_shared_preprocess($vars);
+  // We support not outputting fields when they are empty, so indicate so.
+  $vars['hide_empty_support'] = TRUE;
   _views_data_export_body_shared_preprocess($vars);
 }
 
@@ -371,6 +373,8 @@ function template_preprocess_views_data_export_xml_footer(&$vars) {
  */
 function template_preprocess_views_data_export_xml_body(&$vars) {
   _views_data_export_header_shared_preprocess($vars);
+  // We support not outputting fields when they are empty, so indicate so.
+  $vars['hide_empty_support'] = TRUE;
   _views_data_export_body_shared_preprocess($vars);
 
   // Compute the tag name based on the views base table, minus any trailing 's'.
@@ -465,6 +469,7 @@ function _views_data_export_header_shared_preprocess(&$vars) {
 function _views_data_export_body_shared_preprocess(&$vars) {
   $view     = $vars['view'];
   $fields   = &$view->field;
+  $hide_empty_support = !empty($vars['hide_empty_support']);
 
   $rows = $vars['rows'];
 
@@ -475,7 +480,15 @@ function _views_data_export_body_shared_preprocess(&$vars) {
 
     foreach ($keys as $id) {
       if (empty($fields[$id]->options['exclude'])) {
-        $vars['themed_rows'][$num][$id] = $view->style_plugin->rendered_fields[$num][$id];
+        $content = $view->style_plugin->rendered_fields[$num][$id];
+
+        if ($hide_empty_support && !empty($fields[$id]->options['hide_empty'])) {
+          if ($fields[$id]->is_value_empty($content, $fields[$id]->options['empty_zero'])) {
+            continue;
+          }
+        }
+
+        $vars['themed_rows'][$num][$id] = $content;
       }
     }
   }
