public function saveJSON($path_or_resource, $mode = 'wb')
	{
		$json = $this->_root->asJSON();

		if (is_resource($path_or_resource))
		{
			return fwrite($path_or_resource, $json);
		}

		$fp = fopen($path_or_resource, $mode);
		$bytes = fwrite($fp, $json);
		fclose($fp);

		return $bytes;
	}