code: def generate_hash_id(node):
      
      try:
          content = tostring(node)
      except Exception:
          logger.exception("Generating of hash failed")
          content = to_bytes(repr(node))
  
      hash_id = md5(content).hexdigest()
      return hash_id[:8]
docs: Generates a hash_id for the node in question.
  
      :param node: lxml etree node