protected function process() {
		$this->result = $this->getRequest()->getResponse();

    $contentType = $this->result->getContentType();
		
		// Does the header indicate an XML payload? If so, set the result to be a SimpleXMLElement
		if (preg_match('/^\s*(text\/xml|application\/.*xml).*$/', $contentType)) {
			// If the body is available, then parse the XML
			$body = trim($this->result->getBody(true));
			if ($body) {
				$xml = new \SimpleXMLElement($body);
				$this->result = $xml;
			}
		}

    // Does the header indicate a JSON payload? If so, set the result to a json_decoded object
    if(preg_match('/^\s*(text\/javascript|application\/json|application\/vnd\.rightscale\..*json).*$/', $contentType)) {
      $body = trim($this->result->getBody(true));
      $this->result = json_decode($body);
    }
	}