public function decodeResponse($response) {

        $xml_data = simplexml_load_string($response);

        if ( $xml_data === false ) throw new XmlrpcException("Not a valid XMLRPC response");

        $data = array();

        try {

            if ( isset($xml_data->fault) ) {

                $this->is_fault = true;

                array_push($data, $this->decodeValue($xml_data->fault->value));

            } else if ( isset($xml_data->params) ) {

                foreach ( $xml_data->params->param as $param ) array_push($data, $this->decodeValue($param->value));

            } else throw new XmlrpcException("Uncomprensible response");

        } catch (XmlrpcException $xe) {
            
            throw $xe;
            
        }

        return isset($data[0]) ? $data[0] : $data;

    }