def _update_version_in_install_rdf(content, new_version_number):
 tree = lxml.etree.fromstring(content)
 namespace = 'http://www.mozilla.org/2004/em-rdf#'
 version_uri = '{{{0}}}version'.format(namespace)
 for node in tree.xpath('//em:version | //*[@em:version]', namespaces={'em': namespace}):
  if (node.tag == version_uri):
   node.text = new_version_number
  else:
   node.set(version_uri, new_version_number)
 return lxml.etree.tostring(tree, xml_declaration=True, encoding='utf-8')

def _update_version_in_install_rdf ( content , new_version_number ) : tree = lxml . etree . fromstring ( content ) namespace = 'http://www.mozilla.org/2004/em-rdf#' version_uri = '{{{0}}}version' . format ( namespace ) for node in tree . xpath ( '//em:version | //*[@em:version]' , namespaces = { 'em' : namespace } ) : if ( node . tag == version_uri ) : node . text = new_version_number else : node . set ( version_uri , new_version_number ) return lxml . etree . tostring ( tree , xml_declaration = True , encoding = 'utf-8' )
change the version number in the install .