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;
    }