protected function marshallFile(QtiFile $file)
    {
        $data = array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData()))));

        if ($file->hasFilename() === true) {
            $data['base']['file']['name'] = $file->getFilename();
        }

        return $data;
    }