/**
  * @param $str_xml
  * @return PagSeguroTransactionSearchResult
  */
 public static function readSearchResult($str_xml)
 {
     $parser = new PagSeguroXmlParser($str_xml);
     $data = $parser->getResult('transactionSearchResult');
     $searchResutlt = new PagSeguroTransactionSearchResult();
     if (isset($data['totalPages'])) {
         $searchResutlt->setTotalPages($data['totalPages']);
     }
     if (isset($data['date'])) {
         $searchResutlt->setDate($data['date']);
     }
     if (isset($data['resultsInThisPage'])) {
         $searchResutlt->setResultsInThisPage($data['resultsInThisPage']);
     }
     if (isset($data['currentPage'])) {
         $searchResutlt->setCurrentPage($data['currentPage']);
     }
     if (isset($data['transactions']) && is_array($data['transactions'])) {
         $transactions = array();
         if (isset($data['transactions']['transaction'][0])) {
             $i = 0;
             foreach ($data['transactions']['transaction'] as $key => $value) {
                 $transactions[$i++] = self::parseTransactionSummary($value);
             }
         } else {
             $transactions[0] = self::parseTransactionSummary($data['transactions']['transaction']);
         }
         $searchResutlt->setTransactions($transactions);
     }
     return $searchResutlt;
 }