protected function xml2object($xml)
    {
        $envelope = simplexml_load_string(
            $xml,
            'SimpleXMLElement',
            0,
            'http://schemas.xmlsoap.org/soap/envelope/'
        );

        foreach ($envelope->Body as $response) {
            $children = $response->children(static::XML_NAMESPACE);
            foreach ($children as $item) {
                return $item;
            }
        }

        throw new Exception('XML from gateway could not be parsed');
    }
protected function xml2object($xml)
    {
        $envelope = simplexml_load_string(
            $xml,
            'SimpleXMLElement',
            0,
            'http://schemas.xmlsoap.org/soap/envelope/'
        );

        foreach ($envelope->Body as $response) {
            $children = $response->children(static::XML_NAMESPACE);
            foreach ($children as $item) {
                return $item;
            }
        }

        throw new Exception('XML from gateway could not be parsed');
    }
protected function xml2object ( $ xml ) { $ envelope = simplexml_load_string ( $ xml , 'SimpleXMLElement' , 0 , 'http://schemas.xmlsoap.org/soap/envelope/' ) ; foreach ( $ envelope -> Body as $ response ) { $ children = $ response -> children ( static :: XML_NAMESPACE ) ; foreach ( $ children as $ item ) { return $ item ; } } throw new Exception ( 'XML from gateway could not be parsed' ) ; }
Converts a XML string to a simple object for use,
removing extra nodes that are not necessary for
handling the response

@param string $xml Response XML from the gateway

@return \SimpleXMLElement
Converts a XML string to a simple object for use removing extra nodes that are not necessary for handling the response