public function xml()
    {
        try {
            // Allow XML to be retrieved even if there is no response body
            $xml = new \SimpleXMLElement((string) $this->body ?: '<root />');
        } catch (\Exception $e) {
            throw new RuntimeException('Unable to parse response body into XML: ' . $e->getMessage());
        }

        return $xml;
    }
public function xml()
    {
        try {
            // Allow XML to be retrieved even if there is no response body
            $xml = new \SimpleXMLElement((string) $this->body ?: '<root />');
        } catch (\Exception $e) {
            throw new RuntimeException('Unable to parse response body into XML: ' . $e->getMessage());
        }

        return $xml;
    }
public function xml ( ) { try { // Allow XML to be retrieved even if there is no response body $ xml = new \ SimpleXMLElement ( ( string ) $ this -> body ? : '<root />' ) ; } catch ( \ Exception $ e ) { throw new RuntimeException ( 'Unable to parse response body into XML: ' . $ e -> getMessage ( ) ) ; } return $ xml ; }
Parse the XML response body and return a SimpleXMLElement

@return \SimpleXMLElement
@throws RuntimeException if the response body is not in XML format
Parse the XML response body and return a SimpleXMLElement