public function getInstanceDocumentAsMemoryFile()
	{
		// If this returns null there is no instance document
		$xbrl = $this->getInstanceDocument( false );
		if ( ! $xbrl ) return false;

		$instanceFilename = "mem://{$this->instanceDocument}";

		if ( ! class_exists("MemoryStream", true ) )
		{
			/**
			 * Load the dictionary class
			 */
			$utiltiesPath = isset( $_ENV['UTILITY_LIBRARY_PATH'] )
				? $_ENV['UTILITY_LIBRARY_PATH']
				: ( defined( 'UTILITY_LIBRARY_PATH' ) ? UTILITY_LIBRARY_PATH : __DIR__ . "/../utilities" );
			require_once "$utiltiesPath/MemoryStream.php";
		}

		$f = fopen( $instanceFilename, "w+" );
		fwrite( $f, $xbrl );
		fclose( $f );

		return $instanceFilename;
	}