public function containerFromString ($data) {
        if (strpos($data, 'PK') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new BdocContainer($file));
        } elseif (strpos(trim($data), '<') === 0) {
            $file = $this->createFile();
            file_put_contents($file, $data);

            return new SessionContainerAdapter($this, new DdocContainer($file));
        }
        throw new DigidocException('Invalid container format');
    }