code: def xml2dict(root):
      
      output = {}
      if root.items():
          output.update(dict(root.items()))
  
      for element in root:
          if element:
              if len(element) == 1 or element[0].tag != element[1].tag:
                  one_dict = xml2dict(element)
              else:
                  one_dict = {ns(element[0].tag): xml2list(element)}
  
              if element.items():
                  one_dict.update(dict(element.items()))
              output.update({ns(element.tag): one_dict})
  
          elif element.items():
              output.update({ns(element.tag): dict(element.items())})
  
          else:
              output.update({ns(element.tag): element.text})
  
      return output
docs: Use functions instead of Class and remove namespace based on:
      http://stackoverflow.com/questions/2148119