protected function getXmlElement($response)
    {
        try{
            $xmlElement = new \SimpleXMLElement($response->getContent());
        } catch (\Exception $e) {
            throw new BolException('Error parsing the xml as SimpleXMLElement', null, $e);
        }
        if ($response->getStatusCode() !== 200) {
            throw new BolException($xmlElement->Status . ': ' . $xmlElement->Message, $response->getStatusCode());
        }

        return $xmlElement;
    }
protected function getXmlElement($response)
    {
        try{
            $xmlElement = new \SimpleXMLElement($response->getContent());
        } catch (\Exception $e) {
            throw new BolException('Error parsing the xml as SimpleXMLElement', null, $e);
        }
        if ($response->getStatusCode() !== 200) {
            throw new BolException($xmlElement->Status . ': ' . $xmlElement->Message, $response->getStatusCode());
        }

        return $xmlElement;
    }
protected function getXmlElement ( $ response ) { try { $ xmlElement = new \ SimpleXMLElement ( $ response -> getContent ( ) ) ; } catch ( \ Exception $ e ) { throw new BolException ( 'Error parsing the xml as SimpleXMLElement' , null , $ e ) ; } if ( $ response -> getStatusCode ( ) !== 200 ) { throw new BolException ( $ xmlElement -> Status . ': ' . $ xmlElement -> Message , $ response -> getStatusCode ( ) ) ; } return $ xmlElement ; }
Convert response into SimpleXmlElement and throw an exception if parsing is impossible
Also throws an exception if response status code is not 200
@param $response
@return \SimpleXMLElement
@throws Exception
Convert response into SimpleXmlElement and throw an exception if parsing is impossible Also throws an exception if response status code is not 200