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);
    }
	}
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);
    }
	}
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 ) ; } }
Create the result of the command after the request has been completed.

Different from the overridden method in that it properly detects the 1.5 API content type
'application/vnd.rightscale.cloud+xml' as XML, and it does NOT silently ignore XML parsing errors

TODO: Not sure what exceptions (if any) get thrown, but the original implemenation eats them with
a try/catch with no handling in the catch.

(non-PHPdoc)
@see Guzzle\Service\Command.AbstractCommand::process()

@throws Exception
Create the result of the command after the request has been completed .