def removeH1(document):
 h1 = domhelpers.findNodesNamed(document, 'h1')
 empty = dom.Element('span')
 for node in h1:
  node.parentNode.replaceChild(empty, node)

def removeH1 ( document ) : h1 = domhelpers . findNodesNamed ( document , 'h1' ) empty = dom . Element ( 'span' ) for node in h1 : node . parentNode . replaceChild ( empty , node )
replace all c{h1} nodes in the given document with empty c{span} nodes .