code: def terminate_instances(self, xml_bytes):
          
          root = XML(xml_bytes)
          result = []
          # May be a more elegant way to do this:
          instances = root.find("instancesSet")
          if instances is not None:
              for instance in instances:
                  instanceId = instance.findtext("instanceId")
                  previousState = instance.find("previousState").findtext(
                      "name")
                  currentState = instance.find("currentState").findtext(
                      "name")
                  result.append((instanceId, previousState, currentState))
          return result
docs: Parse the XML returned by the C{TerminateInstances} function.
  
          @param xml_bytes: XML bytes with a C{TerminateInstancesResponse} root
              element.
          @return: An iterable of C{tuple} of (instanceId, previousState,
              currentState) for the ec2 instances that where terminated.