public function toJson($format = Document::MININAL, $options = 0)
    {
        $this->exceptionlevel = 4;

        $json = json_encode($this->toArray($format), $options);

        $this->exceptionlevel = 3;

        return $json;
    }