def xhtml_to_html(xhtml):
 try:
  xhtml = xhtml.getroot()
 except AttributeError:
  pass
 prefix = ('{%s}' % XHTML_NAMESPACE)
 prefix_len = len(prefix)
 for el in xhtml.iter((prefix + '*')):
  el.tag = el.tag[prefix_len:]

def xhtml_to_html ( xhtml ) : try : xhtml = xhtml . getroot ( ) except AttributeError : pass prefix = ( '{%s}' % XHTML_NAMESPACE ) prefix_len = len ( prefix ) for el in xhtml . iter ( ( prefix + '*' ) ) : el . tag = el . tag [ prefix_len : ]
convert all tags in an xhtml tree to html by removing their xhtml namespace .