def extension_element_to_element(extension_element, translation_functions, namespace=None):
 try:
  element_namespace = extension_element.namespace
 except AttributeError:
  element_namespace = extension_element.c_namespace
 if (element_namespace == namespace):
  try:
   try:
    ets = translation_functions[extension_element.tag]
   except AttributeError:
    ets = translation_functions[extension_element.c_tag]
   return ets(extension_element.to_string())
  except KeyError:
   pass
 return None

def extension_element_to_element ( extension_element , translation_functions , namespace = None ) : try : element_namespace = extension_element . namespace except AttributeError : element_namespace = extension_element . c_namespace if ( element_namespace == namespace ) : try : try : ets = translation_functions [ extension_element . tag ] except AttributeError : ets = translation_functions [ extension_element . c_tag ] return ets ( extension_element . to_string ( ) ) except KeyError : pass return None
convert an extension element to a normal element .