code: def key_is_valid_xml(key):
      
      LOG.info('Inside key_is_valid_xml(). Testing "%s"' % (unicode_me(key)))
      test_xml = '<?xml version="1.0" encoding="UTF-8" ?><%s>foo</%s>' % (key, key)
      try:
          parseString(test_xml)
          return True
      except Exception: # minidom does not implement exceptions well
          return False
docs: Checks that a key is a valid XML name