def _updateNamespace(item, new_namespace):
 temp_item = ''
 i = item.tag.find('}')
 if (i >= 0):
  temp_item = item.tag[(i + 1):]
 else:
  temp_item = item.tag
 item.tag = '{{{0}}}{1}'.format(new_namespace, temp_item)
 for child in item.getiterator():
  if isinstance(child.tag, string_types):
   temp_item = ''
   i = child.tag.find('}')
   if (i >= 0):
    temp_item = child.tag[(i + 1):]
   else:
    temp_item = child.tag
   child.tag = '{{{0}}}{1}'.format(new_namespace, temp_item)
 return item

def _updateNamespace ( item , new_namespace ) : temp_item = '' i = item . tag . find ( '}' ) if ( i >= 0 ) : temp_item = item . tag [ ( i + 1 ) : ] else : temp_item = item . tag item . tag = '{{{0}}}{1}' . format ( new_namespace , temp_item ) for child in item . getiterator ( ) : if isinstance ( child . tag , string_types ) : temp_item = '' i = child . tag . find ( '}' ) if ( i >= 0 ) : temp_item = child . tag [ ( i + 1 ) : ] else : temp_item = child . tag child . tag = '{{{0}}}{1}' . format ( new_namespace , temp_item ) return item
helper function to recursively update the namespaces of an item .