code: def _find_elements(self, result, elements):
      
      element_mapping = {}
      result = StringIO.StringIO(result)
      for _, e in ET.iterparse(result, events=('end',)):
        if not elements:
          break
        if e.tag in elements:
          element_mapping[e.tag] = e.text
          elements.remove(e.tag)
      return element_mapping
docs: Find interesting elements from XML.
  
      This function tries to only look for specified elements
      without parsing the entire XML. The specified elements is better
      located near the beginning.
  
      Args:
        result: response XML.
        elements: a set of interesting element tags.
  
      Returns:
        A dict from element tag to element value.