code: public function analyze(SendResult $response)
      {
          $analyzeResponse = new Result($response);
  
          $domXpath = $this->makeDomXpath($response->responseXml);
  
          $queryAllErrorCodes = "//m:generalErrorGroup//m:errorNumber/m:errorDetails/m:errorCode";
          $queryAllErrorMsg = "//m:generalErrorGroup/m:genrealErrorText/m:freeText";
  
          $errorCodeNodeList = $domXpath->query($queryAllErrorCodes);
  
          if ($errorCodeNodeList->length > 0) {
              $analyzeResponse->status = Result::STATUS_ERROR;
  
              $code = $errorCodeNodeList->item(0)->nodeValue;
              $errorTextNodeList = $domXpath->query($queryAllErrorMsg);
              $message = $this->makeMessageFromMessagesNodeList($errorTextNodeList);
  
              $analyzeResponse->messages[] = new Result\NotOk($code, trim($message));
          }
  
          return $analyzeResponse;
      }
docs: Analysing a PNR_DisplayHistoryReply
  
  @param SendResult $response
  @return Result