Index: /anuga_core/documentation/user_manual/demos/cairns/cairns.lic
===================================================================
--- /anuga_core/documentation/user_manual/demos/cairns/cairns.lic	(revision 5021)
+++ /anuga_core/documentation/user_manual/demos/cairns/cairns.lic	(revision 5022)
@@ -9,5 +9,5 @@
     <filename>cairns.asc</filename>
     <checksum>88429353</checksum>
-    <publishable>No</publishable>
+    <publishable></publishable>
     <accountable>Jane Sexton</accountable>
     <source>where did it come from?</source>
@@ -19,5 +19,5 @@
     <filename>cairns.prj</filename>
     <checksum>-2029103677</checksum>
-    <publishable>No</publishable>
+    <publishable></publishable>
     <accountable>Jane Sexton</accountable>
     <source></source>
Index: /anuga_core/source/anuga/utilities/data_audit.py
===================================================================
--- /anuga_core/source/anuga/utilities/data_audit.py	(revision 5021)
+++ /anuga_core/source/anuga/utilities/data_audit.py	(revision 5022)
@@ -82,5 +82,5 @@
             try:
                 license_file_is_valid(fid, datafile, dirpath,
-                                      verbose=verbose)
+                                      verbose=False)
             except audit_exceptions, e:
                 all_files_accounted_for = False                                
@@ -311,5 +311,4 @@
             raise NotPublishable, msg
         
-        print 'PUB', publishable
         if publishable.upper() != 'YES':
             msg = 'Data file %s is not flagged as publishable'\
Index: /anuga_core/source/anuga/utilities/test_xml_tools.py
===================================================================
--- /anuga_core/source/anuga/utilities/test_xml_tools.py	(revision 5021)
+++ /anuga_core/source/anuga/utilities/test_xml_tools.py	(revision 5022)
@@ -132,4 +132,93 @@
 
 
+
+
+    def test_xml2object_empty_fields(self):
+        """Test that XML_document can be generated from file
+        This on tests that empty fields are treated as ''
+        """
+
+        tmp_fd , tmp_name = mkstemp(suffix='.xml', dir='.')
+        fid = os.fdopen(tmp_fd, 'w')
+        
+	xml_string = """<?xml version="1.0" encoding="iso-8859-1"?>
+  <ga_license_file>
+    <metadata>
+      <author>Ole Nielsen</author>
+      <svn_keywords>
+        <author>$Author$</author>  
+        <date>$Date$</date>
+        <revision>$Revision$</revision>
+        <url>$URL:$</url>
+        <id>$Id$</id>
+      </svn_keywords>
+    </metadata>
+    <datafile>
+      <filename>bathymetry.asc</filename>
+      <checksum>%s</checksum>
+      <publishable></publishable>
+      <accountable>Jane Sexton</accountable>
+      <source>Unknown</source>
+      <IP_owner>Geoscience Australia</IP_owner>
+      <IP_info>This is a test</IP_info>
+    </datafile>
+  </ga_license_file>
+""" %('1234')
+
+	fid.write(xml_string)
+	fid.close()
+
+        fid = open(tmp_name)
+	reference = fid.read()
+        reflines = reference.split('\n')
+	
+        xmlobject = xml2object(fid, verbose=True)
+
+
+        #print xmlobject.pretty_print()
+        
+        xmllines = str(xmlobject).split('\n')
+
+        #for line in reflines:
+        #    print line
+        #print    
+        #for line in xmllines:
+        #    print line            
+
+            
+        ##assert len(reflines) == len(xmllines)
+        x = xmlobject['ga_license_file']['datafile']['publishable']
+        msg = 'Got %s, should have been an empty string' %x
+        assert x == '', msg
+        
+
+        for i, refline in enumerate(reflines):
+            msg = '%s != %s' %(refline.strip(), xmllines[i].strip())
+            assert refline.strip() == xmllines[i].strip(), msg
+
+        # Check dictionary behaviour    
+        for tag in xmlobject['ga_license_file'].keys():
+            xmlobject['ga_license_file'][tag]
+
+        assert xmlobject['ga_license_file']['datafile']['accountable'] == 'Jane Sexton'
+
+
+        
+
+        #print
+        #print xmlobject['ga_license_file']['datafile']
+        #print xmlobject['ga_license_file']['metadata']
+        #print xmlobject['ga_license_file']['datafile']
+        #print xmlobject['ga_license_file']['datafile']['accountable']        
+        #print xmlobject['ga_license_file']['datafile'].keys()
+
+        #for tag in xmlobject['ga_license_file'].keys():
+        #    print xmlobject['ga_license_file'][tag]
+	    	
+        # Clean up
+        fid.close()
+        os.remove(tmp_name)
+
+
 	
 
Index: /anuga_core/source/anuga/utilities/xml_tools.py
===================================================================
--- /anuga_core/source/anuga/utilities/xml_tools.py	(revision 5021)
+++ /anuga_core/source/anuga/utilities/xml_tools.py	(revision 5022)
@@ -168,4 +168,6 @@
         for node in self.value:
             if node.tag == key:
+                #print 'node tag = %s, node value = %s' %(node.tag, node.value)
+                
                 if isinstance(node.value, basestring):
                     result.append(str(node.value))
@@ -174,5 +176,6 @@
                     result.append(node)
                     #return node
-                    
+
+        #print 'result', result
         if len(result) == 0:
             return None
@@ -255,9 +258,4 @@
     for n in node.childNodes:
 
-        #print 'Node name: "%s",' %n.nodeName,\
-        #      'Node type: "%s",' %n.nodeType,\
-        #      'Node value: "%s",' %str(n.nodeValue).strip(),\
-        #      'Node children: %d' %len(n.childNodes)        
-
         if n.nodeType == 3:
             # Child is a text element - omit the dom tag #text and
@@ -275,8 +273,12 @@
             value = x
         else:
+            # XML element
+
             value.append(dom2object(n))
 
-
-
+                
+    # Deal with empty elements
+    if len(value) == 0: value = ''
+    
 
     if node.nodeType == 9:
@@ -292,2 +294,15 @@
         
     return X
+
+
+
+
+
+    #=================== Useful print statement
+    #if n.nodeType == 3 and str(n.nodeValue).strip() == '':
+    #    pass
+    #else:
+    #    print 'Node name: "%s",' %n.nodeName,\
+    #          'Node type: "%s",' %n.nodeType,\
+    #          'Node value: "%s",' %str(n.nodeValue).strip(),\
+    #          'Node children: %d' %len(n.childNodes)        
