From 2192538b4f396ec1db279d875d663515222682f0 Mon Sep 17 00:00:00 2001
From: Arnaud PAUGET <arnaud.pauget@maarch.org>
Date: Mon, 26 Oct 2020 11:52:32 +0100
Subject: [PATCH] refactor() : cleaning source

---
 .../exportSeda/class/AbstractMessage.php      | 184 ----
 .../exportSeda/class/Acknowledgement.php      | 137 ---
 .../exportSeda/class/ArchiveTransfer.php      | 876 ----------------
 .../exportSeda/class/ArchiveTransferReply.php | 143 ---
 .../controllers/SendMessageController.php     |   6 +-
 .../exportSeda/models/Acknowledgement.php     | 137 ---
 .../exportSeda/models/ArchiveTransfer.php     | 876 ----------------
 .../models/ArchiveTransferReply.php           | 143 ---
 .../exportSeda/models/ExportSedaModel.php     |  19 -
 .../models/ExportSedaModelAbstract.php        |  19 -
 .../exportSeda/resources/AbstractRule.xml     |   4 +
 .../exportSeda/resources/Acknowledgement.xml  |  17 +
 .../external/exportSeda/resources/Agent.xml   |  15 +
 .../resources/ArchivalAgreement.xml           |   1 +
 .../ArchiveModificationNotification.xml       |  16 +
 .../exportSeda/resources/ArchiveTransfer.xml  |  18 +
 .../resources/ArchiveTransferReply.xml        |  22 +
 .../exportSeda/resources/ArchiveUnit.xml      | 224 +++++
 .../resources/ArchiveUnitChildren.xml         | 131 +++
 .../exportSeda/resources/CodeListVersions.xml |  17 +
 .../resources/DataObjectPackage.xml           |  28 +
 .../resources/ManagementMetadata.xml          |  60 ++
 .../resources/MessageIdentifier.xml           |   1 +
 .../resources/MessageReceivedIdentifier.xml   |   1 +
 .../resources/MessageRequestIdentifier.xml    |   1 +
 .../exportSeda/resources/Organization.xml     |  41 +
 .../resources/xsd/seda-2.0-descriptive.xsd    |  94 ++
 .../resources/xsd/seda-2.0-main.xsd           | 816 +++++++++++++++
 .../resources/xsd/seda-2.0-management.xsd     | 446 ++++++++
 .../resources/xsd/seda-2.0-ontology.xsd       | 950 ++++++++++++++++++
 .../resources/xsd/seda-2.0-technical.xsd      | 481 +++++++++
 .../resources/xsd/seda-2.0-types.xsd          | 349 +++++++
 .../exportSeda/resources/xsd/xlink.xsd        | 270 +++++
 .../external/exportSeda/resources/xsd/xml.xsd | 287 ++++++
 34 files changed, 4293 insertions(+), 2537 deletions(-)
 delete mode 100644 src/app/external/exportSeda/class/AbstractMessage.php
 delete mode 100644 src/app/external/exportSeda/class/Acknowledgement.php
 delete mode 100644 src/app/external/exportSeda/class/ArchiveTransfer.php
 delete mode 100644 src/app/external/exportSeda/class/ArchiveTransferReply.php
 delete mode 100644 src/app/external/exportSeda/models/Acknowledgement.php
 delete mode 100644 src/app/external/exportSeda/models/ArchiveTransfer.php
 delete mode 100644 src/app/external/exportSeda/models/ArchiveTransferReply.php
 delete mode 100755 src/app/external/exportSeda/models/ExportSedaModel.php
 delete mode 100755 src/app/external/exportSeda/models/ExportSedaModelAbstract.php
 create mode 100644 src/app/external/exportSeda/resources/AbstractRule.xml
 create mode 100644 src/app/external/exportSeda/resources/Acknowledgement.xml
 create mode 100644 src/app/external/exportSeda/resources/Agent.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchivalAgreement.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchiveModificationNotification.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchiveTransfer.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchiveTransferReply.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchiveUnit.xml
 create mode 100644 src/app/external/exportSeda/resources/ArchiveUnitChildren.xml
 create mode 100644 src/app/external/exportSeda/resources/CodeListVersions.xml
 create mode 100644 src/app/external/exportSeda/resources/DataObjectPackage.xml
 create mode 100644 src/app/external/exportSeda/resources/ManagementMetadata.xml
 create mode 100644 src/app/external/exportSeda/resources/MessageIdentifier.xml
 create mode 100644 src/app/external/exportSeda/resources/MessageReceivedIdentifier.xml
 create mode 100644 src/app/external/exportSeda/resources/MessageRequestIdentifier.xml
 create mode 100644 src/app/external/exportSeda/resources/Organization.xml
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-descriptive.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-main.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-management.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-ontology.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-technical.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/seda-2.0-types.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/xlink.xsd
 create mode 100644 src/app/external/exportSeda/resources/xsd/xml.xsd

diff --git a/src/app/external/exportSeda/class/AbstractMessage.php b/src/app/external/exportSeda/class/AbstractMessage.php
deleted file mode 100644
index ba4ea1f3db3..00000000000
--- a/src/app/external/exportSeda/class/AbstractMessage.php
+++ /dev/null
@@ -1,184 +0,0 @@
-<?php
-
-require_once __DIR__ .  DIRECTORY_SEPARATOR .'../RequestSeda.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-
-if ($_SESSION['config']['app_id']) {
-    require_once 'apps/maarch_entreprise/class/class_pdf.php';
-}
-
-class AbstractMessage{
-
-    private $db;
-    private $xml;
-    private $directoryMessage;
-    public function __construct()
-    {
-        $this->db = new RequestSeda();
-
-        $getXml = false;
-        $path = '';
-        if (file_exists(
-            $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-            . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-                . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-                . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-                . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        } elseif (file_exists(
-            $_SESSION['config']['corepath'] . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'.  DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'
-                . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        }
-
-        if ($getXml) {
-            $this->xml = simplexml_load_file($path);
-
-            $this->directoryMessage = (string) $this->xml->CONFIG->directoryMessage;
-        }
-    }
-
-    public function generatePackage($reference, $name)
-    {
-        $message = $this->db->getMessageByReference($reference);
-        $messageObject = json_decode($message->data);
-
-        if (!is_dir($this->directoryMessage)) {
-            umask(0);
-            mkdir($this->directoryMessage, 0777, true);
-        }
-
-        if (!is_dir($this->directoryMessage . DIRECTORY_SEPARATOR . $messageObject->MessageIdentifier->value)) {
-            umask(0);
-            mkdir($this->directoryMessage . DIRECTORY_SEPARATOR . $messageObject->MessageIdentifier->value, 0777, true);
-        }
-
-        $this->sendAttachment($messageObject);
-
-        $this->saveXml($messageObject, $name, ".xml");
-    }
-
-    public function saveXml($messageObject, $name, $extension)
-    {
-        if (isset($messageObject->DataObjectPackage)) {
-            if ($messageObject->DataObjectPackage->BinaryDataObject) {
-                foreach ($messageObject->DataObjectPackage->BinaryDataObject as $binaryDataObject) {
-                    unset($binaryDataObject->Attachment->value);
-                }
-            }
-        }
-
-        $DOMTemplate = new DOMDocument();
-        $DOMTemplate->preserveWhiteSpace = false;
-        $DOMTemplate->formatOutput = true;
-        $DOMTemplate->load(__DIR__ .DIRECTORY_SEPARATOR. '..'. DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.$name.'.xml');
-        $DOMTemplateProcessor = new DOMTemplateProcessor($DOMTemplate);
-        $DOMTemplateProcessor->setSource($name, $messageObject);
-        $DOMTemplateProcessor->merge();
-        $DOMTemplateProcessor->removeEmptyNodes();
-
-        try {
-            if (!is_dir($this->directoryMessage)) {
-                umask(0);
-                mkdir($this->directoryMessage, 0777, true);
-            }
-
-            if (!is_dir($this->directoryMessage . DIRECTORY_SEPARATOR . $messageObject->MessageIdentifier->value)) {
-                umask(0);
-                mkdir($this->directoryMessage . DIRECTORY_SEPARATOR . $messageObject->MessageIdentifier->value, 0777, true);
-            }
-
-            if (!file_exists($this->directoryMessage . DIRECTORY_SEPARATOR.$messageObject->MessageIdentifier->value.DIRECTORY_SEPARATOR. $messageObject->MessageIdentifier->value . $extension)) {
-                $DOMTemplate->save($this->directoryMessage . DIRECTORY_SEPARATOR.$messageObject->MessageIdentifier->value.DIRECTORY_SEPARATOR. $messageObject->MessageIdentifier->value . $extension);
-            }
-
-        } catch (Exception $e) {
-            return false;
-        }
-    }
-
-    public function addAttachment($reference, $resIdMaster, $fileName, $extension, $title, $type) {
-        $db = new RequestSeda();
-        $object = new stdClass();
-        $dir =  $this->directoryMessage . DIRECTORY_SEPARATOR . $reference . DIRECTORY_SEPARATOR;
-
-        $object->tmpDir = $dir;
-        $object->size = filesize($dir);
-        $object->format = $extension;
-        $object->tmpFileName = $fileName;
-        $object->title = $title;
-        $object->attachmentType = "simple_attachment";
-        $object->resIdMaster = $resIdMaster;
-
-        return $db->insertAttachment($object, $type);
-    }
-
-    private function sendAttachment($messageObject)
-    {
-        $messageId = $messageObject->MessageIdentifier->value;
-
-        foreach ($messageObject->DataObjectPackage->BinaryDataObject as $binaryDataObject) {
-            $dest = $this->directoryMessage . DIRECTORY_SEPARATOR . $messageId . DIRECTORY_SEPARATOR . $binaryDataObject->Attachment->filename;
-
-            if (!file_exists($dest)) {
-                copy($binaryDataObject->Uri, $dest);
-
-                unset($binaryDataObject->Uri);
-            }
-        }
-
-        $this->db->updateDataMessage($messageObject->MessageIdentifier->value, json_encode($messageObject));
-    }
-
-    public function addTitleToMessage($reference, $title = ' ')
-    {
-        $message = $this->db->getMessageByReference($reference);
-
-        $messageObject = json_decode($message->data);
-
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->Title[0] = $title;
-
-        $this->db->updateDataMessage($reference, json_encode($messageObject));
-
-        return true;
-    }
-
-    public function changeStatus($reference, $status)
-    {
-        $message = $this->db->getMessageByReference($reference);
-        $listResId = $this->db->getUnitIdentifierByMessageId($message->message_id);
-
-        for ($i=0; $i < count($listResId); $i++) {
-            $this->db->updateStatusLetterbox($listResId[$i]->res_id, $status);
-        }
-
-        return true;
-    }
-
-    public function createPDF($name, $body)
-    {
-        $pdf = new PDF("p", "pt", "A4");
-        $pdf->SetAuthor("MAARCH");
-        $pdf->SetTitle($name);
-
-        $pdf->SetFont('times', '', 12);
-        $pdf->SetTextColor(50, 60, 100);
-
-        $pdf->AddPage('P');
-
-        $pdf->SetAlpha(1);
-
-        $pdf->MultiCell(0, 10, utf8_decode($body), 0, 'L');
-
-        $dir = $_SESSION['config']['tmppath'] . $name . '.pdf';
-        $pdf->Output($dir, "F");
-    }
-}
diff --git a/src/app/external/exportSeda/class/Acknowledgement.php b/src/app/external/exportSeda/class/Acknowledgement.php
deleted file mode 100644
index a4546c8bf9d..00000000000
--- a/src/app/external/exportSeda/class/Acknowledgement.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class Acknowledgement {
-
-	public function __construct()
-	{
-	}
-
-	public function receive($data, $resIds)
-	{
-	    $messageObject = $this->getMessageObject($data);
-	    $abstractMessage = new AbstractMessage();
-        $abstractMessage->saveXml($messageObject,"Acknowledgement", ".xml");
-
-		foreach ($resIds as $resId) {
-            $abstractMessage->addAttachment($messageObject->MessageIdentifier->value, $resId, $messageObject->MessageIdentifier->value.".xml", "xml", "Accusé de réception",1);
-        }
-
-        return $messageObject;
-	}
-
-    private function getMessageObject($data)
-    {
-        $messageObject = new stdClass();
-
-        $messageObject->Comment = $data->comment;
-        $messageObject->Date = $data->date;
-        $messageObject->MessageIdentifier = $data->messageIdentifier;
-        $messageObject->MessageReceivedIdentifier = $data->messageReceivedIdentifier;
-
-        $messageObject->Receiver = $this->getOrganisation($data->receiver);
-        $messageObject->Sender = $this->getOrganisation($data->sender);
-
-        return $messageObject;
-    }
-
-    private function getOrganisation($data)
-    {
-        $organisationObject = new stdClass();
-        $organisationObject->Identifier = new stdClass();
-        $organisationObject->Identifier->value = $data->id;
-
-        $organisationObject->OrganizationDescriptiveMetadata = new stdClass();
-        $organisationObject->OrganizationDescriptiveMetadata->Name = $data->name;
-        $organisationObject->OrganizationDescriptiveMetadata->LegalClassification = $data->legalClassification;
-
-        if ($data->address) {
-            $organisationObject->OrganizationDescriptiveMetadata->Address = $this->getAddress($data->address);
-        }
-
-        if ($data->communication) {
-            $organisationObject->OrganizationDescriptiveMetadata->Communication = $this->getCommunication($data->communication);
-        }
-
-        if ($data->contact) {
-            $organisationObject->OrganizationDescriptiveMetadata->Contact = $this->getContact($data->contact);
-        }
-
-        return $organisationObject;
-    }
-
-    private function getContact($data)
-    {
-        $listContact = [];
-        foreach ($data as $contact) {
-            $tmpContact =  new stdClass();
-            $tmpContact->DepartmentName = $contact->departmentName;
-            $tmpContact->PersonName = $contact->personName;
-
-            if ($contact->address){
-                $tmpContact->Address = [];
-                $tmpContact->Address = $this->getAddress($contact->address);
-            }
-
-            if ($contact->communication) {
-                $tmpContact->Communication = [];
-                $tmpContact->Communication = $this->getCommunication($contact->communication);
-            }
-            $listContact[] = $tmpContact;
-        }
-        return $listContact;
-    }
-
-    private function getAddress($data)
-    {
-	    $listAddress = [];
-        foreach ($data as $address) {
-            $tmpAddress = new stdClass();
-            $tmpAddress->CityName = $address->cityName;
-            $tmpAddress->Country = $address->country;
-            $tmpAddress->PostCode = $address->postCode;
-            $tmpAddress->StreetName = $address->streetName;
-
-            $listAddress[] = $tmpAddress;
-        }
-        return $listAddress;
-    }
-
-    private function getCommunication($data)
-    {
-        $listCommunication = [];
-        foreach ($data as $communication) {
-            $tmpCommunication = new stdClass();
-            $tmpCommunication->Channel = $communication->channel;
-
-            if ($communication->completeNumber) {
-                $tmpCommunication->value = $communication->completeNumber;
-            } else {
-                $tmpCommunication->value = $communication->URIID;
-            }
-            $listCommunication[] = $tmpCommunication;
-        }
-        return $listCommunication;
-    }
-}
diff --git a/src/app/external/exportSeda/class/ArchiveTransfer.php b/src/app/external/exportSeda/class/ArchiveTransfer.php
deleted file mode 100644
index 87de4f2a7a5..00000000000
--- a/src/app/external/exportSeda/class/ArchiveTransfer.php
+++ /dev/null
@@ -1,876 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../RequestSeda.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class ArchiveTransfer
-{
-    private $db;
-    private $abstractMessage;
-    private $externalLink;
-    private $xml;
-    protected $entities;
-
-    public function __construct()
-    {
-        $this->db = new RequestSeda();
-        $this->abstractMessage = new AbstractMessage();
-        $_SESSION['error'] = "";
-
-        $getXml = false;
-        $path = '';
-        if (file_exists(
-            $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-            . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-                . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-                . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-                . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        } elseif (file_exists(
-            $_SESSION['config']['corepath'] . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'.  DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'
-                . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        }
-
-        if ($getXml) {
-            $this->xml = simplexml_load_file($path);
-        }
-
-        $this->entities = [];
-    }
-
-    public function receive($listResId)
-    {
-        if (!$listResId) {
-            return false;
-        }
-
-        $messageObject = new stdClass();
-        $messageObject = $this->initMessage($messageObject);
-
-        if (!empty($_SESSION['error'])) {
-            return;
-        }
-
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[] = $this->getArchiveUnit(
-            "RecordGrp",
-            null,
-            null,
-            'group_1',
-            null,
-            null
-        );
-
-        $result = $startDate = $endDate = '';
-        $i = 1;
-        foreach ($listResId as $resId) {
-            $this->externalLink = false;
-
-            if (!empty($result)) {
-                $result .= ',';
-            }
-            $result .= $resId;
-
-            $letterbox = $this->db->getLetter($resId);
-            $attachments = $this->db->getAttachments($letterbox->res_id);
-            $notes = $this->db->getNotes($letterbox->res_id);
-            $mails = $this->db->getMails($letterbox->res_id);
-            $links = $this->db->getLinks($letterbox->res_id);
-
-            $relatedObjectReference = [];
-            if (is_array($links)) {
-                foreach ($links as $link) {
-                    if (!array_search($link, $listResId)) {
-                        $relatedObjectReference[$link] = false;
-                    } else {
-                        $relatedObjectReference[$link] = true;
-                    }
-                }
-            } else {
-                if (!array_search($links, $listResId)) {
-                    $relatedObjectReference[$links] = false;
-                } else {
-                    $relatedObjectReference[$links] = true;
-                }
-            }
-
-            $archiveUnitId = 'letterbox_' . $resId;
-            if ($letterbox->filename) {
-                $docServers = $this->db->getDocServer($letterbox->docserver_id);
-                $uri = str_replace("##", DIRECTORY_SEPARATOR, $letterbox->path);
-                $uri = str_replace("#", DIRECTORY_SEPARATOR, $uri);
-                $uri .= $letterbox->filename;
-                $filePath = $docServers->path_template . $uri;
-
-                if (!file_exists($filePath)) {
-                    $_SESSION['error'] = _ERROR_FILE_NOT_EXIST;
-                    return;
-                }
-
-                $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                    "File",
-                    $letterbox,
-                    $attachments,
-                    $archiveUnitId,
-                    $letterbox->res_id,
-                    $relatedObjectReference
-                );
-
-                $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                    $filePath,
-                    $_SESSION['collections'][0]['table'] . '_' . $letterbox->res_id
-                );
-            } else {
-                $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                    "File",
-                    $letterbox,
-                    null,
-                    null,
-                    null,
-                    $relatedObjectReference
-                );
-            }
-
-            if ($attachments) {
-                $j = 1;
-                foreach ($attachments as $attachment) {
-                    $docServers = $this->db->getDocServer($attachment->docserver_id);
-
-                    $uri = str_replace("##", DIRECTORY_SEPARATOR, $attachment->path);
-                    $uri = str_replace("#", DIRECTORY_SEPARATOR, $uri);
-                    $uri .= $attachment->filename;
-
-                    $filePath = $docServers->path_template . $uri;
-                    if ($attachment->attachment_type == "signed_response") {
-                        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Response",
-                            $attachment,
-                            null,
-                            'attachment_'. $i. '_'. $j,
-                            "response_" . $attachment->res_id
-//                            $archiveUnitId
-                        );
-
-                        $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                            $filePath,
-                            $_SESSION['collections'][1]['table'] . '_'.  $attachment->res_id
-                        );
-                        $j++;
-                    } else {
-                        $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                            $filePath,
-                            $_SESSION['collections'][1]['table']. '_'.  $attachment->res_id
-                        );
-                    }
-                }
-            }
-
-            if ($notes) {
-                foreach ($notes as $note) {
-                    $id = 'note_'.$note->id;
-                    $filePath = $_SESSION['config']['tmppath']. DIRECTORY_SEPARATOR. $id. '.pdf';
-
-                    $this->abstractMessage->createPDF($id, $note->note_text);
-                    $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject($filePath, $id);
-                }
-            }
-
-            if ($mails) {
-                foreach ($mails as $mail) {
-                    $id = 'email_'.$mail->email_id;
-                    $filePath = $_SESSION['config']['tmppath']. DIRECTORY_SEPARATOR. $id. '.pdf';
-                    $body = str_replace('###', ';', $mail->email_body);
-                    $data = 'email n°' . $mail->email_id . '
-' .'de ' . $mail->sender_email . '
-' . 'à ' . $mail->to_list . '
-' . 'objet : ' . $mail->email_object . '
-' . 'corps : ' . strip_tags(html_entity_decode($body));
-
-                    $this->abstractMessage->createPDF($id, $data);
-                    $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject($filePath, $id);
-                }
-            }
-
-            $format = 'Y-m-d H:i:s.u';
-            $creationDate = DateTime::createFromFormat($format, $letterbox->creation_date);
-            if ($startDate == '') {
-                $startDate = $creationDate;
-            } elseif ( date_diff($startDate, $creationDate) > 0 ) {
-                $startDate = $creationDate;
-            }
-
-            $modificationDate = DateTime::createFromFormat($format, $letterbox->modification_date);
-            if ($endDate == '') {
-                $endDate = $modificationDate;
-            } elseif ( date_diff($endDate, $modificationDate) < 0) {
-                $endDate = $modificationDate;
-            }
-
-            $i++;
-        }
-
-        $originator = "";
-        foreach ($messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit as $archiveUnit) {
-            if (!empty($archiveUnit->Content->OriginatingAgency->Identifier->value)) {
-                $originator = $archiveUnit->Content->OriginatingAgency->Identifier->value;
-                break;
-            }
-        }
-
-        if (!empty($originator)) {
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency = new stdClass();
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency->Identifier = new stdClass();
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency->Identifier->value = $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[0]->Content->OriginatingAgency->Identifier->value;
-        } else {
-            $_SESSION['error'] = _ERROR_ORIGINATOR_EMPTY;
-        }
-
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->StartDate = $startDate->format('Y-m-d');
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->EndDate = $endDate->format('Y-m-d');
-
-        $messageSaved = $this->saveMessage($messageObject);
-
-        foreach ($listResId as $resId) {
-            $this->db->insertUnitIdentifier($messageSaved['messageId'], "res_letterbox", $resId);
-        }
-
-        return $result;
-    }
-
-    public function deleteMessage($listResId)
-    {
-        if (!$listResId) {
-            return false;
-        }
-
-        $resIds = [];
-        if (!is_array($listResId)) {
-            $resIds[] = $listResId;
-        } else {
-            $resIds = $listResId;
-        }
-
-
-        foreach ($resIds as $resId) {
-            $unitIdentifier = $this->db->getUnitIdentifierByResId($resId);
-            $this->db->deleteMessage($unitIdentifier->message_id);
-            $this->db->deleteUnitIdentifier($resId);
-        }
-
-        return true;
-    }
-
-    private function saveMessage($messageObject)
-    {
-        $data = new stdClass();
-
-        $data->messageId                             = $messageObject->MessageIdentifier->value;
-        $data->date                                  = $messageObject->Date;
-
-        $data->MessageIdentifier                     = new stdClass();
-        $data->MessageIdentifier->value              = $messageObject->MessageIdentifier->value;
-
-        $data->TransferringAgency                    = new stdClass();
-        $data->TransferringAgency->Identifier        = new stdClass();
-        $data->TransferringAgency->Identifier->value = $messageObject->TransferringAgency->Identifier->value;
-
-        $data->ArchivalAgency                        = new stdClass();
-        $data->ArchivalAgency->Identifier            = new stdClass();
-        $data->ArchivalAgency->Identifier->value     = $messageObject->ArchivalAgency->Identifier->value;
-
-        $data->ArchivalAgreement                     = new stdClass();
-        $data->ArchivalAgreement->value              = $messageObject->ArchivalAgreement->value;
-
-        $data->ReplyCode                             = $messageObject->ReplyCode;
-
-        $aArgs                                       = [];
-        $aArgs['fullMessageObject']                  = $messageObject;
-        $aArgs['SenderOrgNAme']                      = "";
-        $aArgs['RecipientOrgNAme']                   = "";
-
-        $messageId = $this->db->insertMessage($data, "ArchiveTransfer", $aArgs);
-
-        return $messageId;
-    }
-
-    private function initMessage($messageObject)
-    {
-
-        $this->directoryMessage = (string) $this->xml->CONFIG->directoryMessage;
-
-        if (!$this->directoryMessage || !is_dir($this->directoryMessage)) {
-            $_SESSION['error'] .= _DIRECTORY_MESSAGE_REQUIRED;
-            return;
-        }
-
-        $date = new DateTime;
-        $messageObject->Date = $date->format(DateTime::ATOM);
-        $messageObject->MessageIdentifier = new stdClass();
-        $messageObject->MessageIdentifier->value = $_SESSION['user']['UserId'] . "-" . date('Ymd-His');
-
-        $messageObject->TransferringAgency = new stdClass();
-        $messageObject->TransferringAgency->Identifier = new stdClass();
-
-        $messageObject->ArchivalAgency = new stdClass();
-        $messageObject->ArchivalAgency->Identifier = new stdClass();
-
-        $messageObject->ArchivalAgreement = new stdClass();
-
-        foreach ($_SESSION['user']['entities'] as $entity) {
-            $res = array_key_exists($entity['ENTITY_ID'], $this->entities);
-            if ($res === false) {
-                $this->entities[$entity['ENTITY_ID']] = $entity = $this->db->getEntity($entity['ENTITY_ID']);
-            } else {
-                $entity = $this->entities[$entity['ENTITY_ID']];
-            }
-
-            if ($entity) {
-                if (!(string) $this->xml->CONFIG->senderOrgRegNumber) {
-                    $_SESSION['error'] .= _TRANSFERRING_AGENCY_SIREN_REQUIRED;
-                }
-
-                if (!$entity->archival_agency) {
-                    $_SESSION['error'] .= _ARCHIVAL_AGENCY_SIREN_REQUIRED;
-                }
-
-                if (!$entity->archival_agreement) {
-                    $_SESSION['error'] .= _ARCHIVAL_AGREEMENT_REQUIRED;
-                }
-
-                if (!empty($_SESSION['error'])) {
-                    return;
-                }
-
-                $messageObject->TransferringAgency->Identifier->value = (string) $this->xml->CONFIG->senderOrgRegNumber;
-                $messageObject->ArchivalAgency->Identifier->value = $entity->archival_agency;
-                $messageObject->ArchivalAgreement->value = $entity->archival_agreement;
-            } else {
-                $_SESSION['error'] .= _NO_ENTITIES;
-            }
-        }
-
-        $messageObject->DataObjectPackage = new stdClass();
-        $messageObject->DataObjectPackage->BinaryDataObject = [];
-        $messageObject->DataObjectPackage->DescriptiveMetadata = new stdClass();
-        $messageObject->DataObjectPackage->ManagementMetadata = new stdClass();
-
-        return $messageObject;
-    }
-
-    private function getArchiveUnit(
-        $type,
-        $object = null,
-        $attachments = null,
-        $archiveUnitId = null,
-        $dataObjectReferenceId = null,
-        $relatedObjectReference = null
-    ) {
-        $archiveUnit = new stdClass();
-
-        if ($archiveUnitId) {
-            $archiveUnit->id = $archiveUnitId;
-        } else {
-            $archiveUnit->id = uniqid();
-        }
-
-        if (isset($object)) {
-            if ($relatedObjectReference) {
-                $archiveUnit->Content = $this->getContent($type, $object, $relatedObjectReference);
-            } else {
-                $archiveUnit->Content = $this->getContent($type, $object);
-            }
-
-            $archiveUnit->Management = $this->getManagement($object);
-        } else {
-            $archiveUnit->Content = $this->getContent($type);
-            $archiveUnit->Management = $this->getManagement();
-        }
-
-
-        if ($dataObjectReferenceId) {
-            $archiveUnit->DataObjectReference = new stdClass();
-            if ($type == 'File') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = $_SESSION['collections'][0]['table'] . '_' .$dataObjectReferenceId;
-            } elseif ($type == 'Note') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = 'note_' .$dataObjectReferenceId;
-            } elseif ($type == 'Email') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = 'email_' .$dataObjectReferenceId;
-            } else {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = $_SESSION['collections'][1]['table'] . '_' .$dataObjectReferenceId;
-            }
-
-        }
-
-        $archiveUnit->ArchiveUnit = [];
-        if ($attachments) {
-            $i = 1;
-            foreach ($attachments as $attachment) {
-                if ($attachment->res_id_master == $object->res_id) {
-                    if ($attachment->attachment_type != "signed_response") {
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Item",
-                            $attachment,
-                            null,
-                            $archiveUnitId. '_attachment_' . $i,
-                            $attachment->res_id
-                        );
-                    }
-                }
-                $i++;
-            }
-        }
-
-        if ($object->res_id) {
-            if ($type != 'Note' && $type != 'Email') {
-                $notes = $this->db->getNotes($object->res_id);
-                if ($notes) {
-                    $i = 1;
-                    foreach ($notes as $note) {
-                        $note->title = 'Note n° ' . $note->id;
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Note",
-                            $note,
-                            null,
-                            $archiveUnitId . '_note_' . $i,
-                            $note->id
-                        );
-                        $i++;
-                    }
-                }
-            }
-
-            if ($type != 'Email' && $type != 'Note') {
-                $emails = $this->db->getMails($object->res_id);
-                if ($emails) {
-                    $i = 1;
-                    foreach ($emails as $email) {
-                        $email->title = 'Email n° ' . $email->email_id;
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Email",
-                            $email,
-                            null,
-                            $archiveUnitId . '_email_' . $i,
-                            $email->email_id
-                        );
-                        $i++;
-                    }
-                }
-            }
-        }
-        if (count($archiveUnit->ArchiveUnit) == 0) {
-            unset($archiveUnit->ArchiveUnit);
-        }
-
-        return $archiveUnit;
-    }
-
-    private function getContent($type, $object = null, $relatedObjectReference = null)
-    {
-
-        $content = new stdClass();
-
-        switch ($type) {
-            case 'RecordGrp':
-                $content->DescriptionLevel = $type;
-                $content->Title = [];
-                $content->DocumentType = 'Dossier';
-
-                return $content;
-                break;
-            case 'File':
-                $content->DescriptionLevel = $type;
-
-                $sentDate = new DateTime($object->doc_date);
-                $receivedDate = new DateTime($object->admission_date);
-                $acquiredDate = new DateTime($object->creaction_date);
-                $content->SentDate = $sentDate->format(DateTime::ATOM);
-                $content->ReceivedDate = $receivedDate->format(DateTime::ATOM);
-                $content->AcquiredDate = $acquiredDate->format(DateTime::ATOM);
-
-                $content->Addressee = [];
-                $content->Keyword = [];
-
-                $keyword = $addressee = $entity = "";
-
-                if ($object->destination) {
-                    $res = array_key_exists($object->destination, $this->entities);
-                    if ($res === false) {
-                        $this->entities[$object->destination] = $entity = $this->db->getEntity($object->destination);
-                    } else {
-                        $entity = $this->entities[$object->destination];
-                    }
-                }
-
-                if ($object->exp_contact_id) {
-                    $contact = $this->db->getContact($object->exp_contact_id);
-                    $keyword = $this->getKeyword($contact);
-                    $addressee = $this->getAddresse($entity, "entity");
-                } elseif ($object->dest_contact_id) {
-                    $contact = $this->db->getContact($object->dest_contact_id);
-                    $addressee = $this->getAddresse($contact);
-                    $keyword = $this->getKeyword($entity, "entity");
-                } elseif ($object->exp_user_id) {
-                    $user = $this->db->getUserInformation($object->exp_user_id);
-                    $keyword = $this->getKeyword($user);
-                    $addressee = $this->getAddresse($entity, "entity");
-                }
-
-                if (!empty($keyword)) {
-                    $content->Keyword[] = $keyword;
-                }
-
-                if (!empty($addressee)) {
-                    $content->Addressee[] = $addressee;
-                }
-
-                $content->Source = '';
-
-                $content->DocumentType = $object->type_label;
-                $content->OriginatingAgencyArchiveUnitIdentifier = $object->alt_identifier;
-                $content->OriginatingSystemId = $object->res_id;
-
-                $content->Title = [];
-                $content->Title[] = $object->subject;
-                break;
-            case 'Item':
-            case 'Attachment':
-            case 'Response':
-            case 'Note':
-            case 'Email':
-                $content->DescriptionLevel = "Item";
-                $content->Title = [];
-                $content->Title[] = $object->title;
-
-                if ($type == "Item") {
-                    $content->DocumentType = "Pièce jointe";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Note") {
-                    $content->DocumentType = "Note";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Email") {
-                    $content->DocumentType = "Courriel";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Response") {
-                    $content->DocumentType = "Réponse";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                }
-
-                break;
-        }
-
-        if (isset($relatedObjectReference)) {
-            $content->RelatedObjectReference = new stdClass();
-            $content->RelatedObjectReference->References = [];
-
-            foreach ($relatedObjectReference as $key => $value) {
-                $reference = new stdClass();
-                if ($value) {
-                    $reference->ArchiveUnitRefId = 'letterbox_' . $key;
-                    $content->RelatedObjectReference->References[] = $reference;
-                } else {
-                    $destination = $this->db->getDestinationLetter($key);
-                    if (isset($destination)) {
-                        $res = array_key_exists($destination, $this->entities);
-                        if ($res === false) {
-                            $this->entities[$destination] = $entity = $this->db->getEntity($destination);
-                        } else {
-                            $entity = $this->entities[$destination];
-                        }
-
-                        $reference->RepositoryArchiveUnitPID = 'originator:' . $entity->business_id . ':' . $key;
-                        $content->RelatedObjectReference->References[] = $reference;
-                    }
-                }
-            }
-
-        }
-
-        if (isset($object->destination)) {
-            $content->OriginatingAgency = new stdClass();
-            $content->OriginatingAgency->Identifier = new stdClass();
-
-            $res = array_key_exists($object->destination, $this->entities);
-            if ($res === false) {
-                $this->entities[$object->destination] = $entity = $this->db->getEntity($object->destination);
-            } else {
-                $entity = $this->entities[$object->destination];
-            }
-            $content->OriginatingAgency->Identifier->value = $entity->business_id;
-
-            if (empty($content->OriginatingAgency->Identifier->value)) {
-                unset($content->OriginatingAgency);
-            }
-        }
-
-        if (isset($object->res_id)) {
-            $content->CustodialHistory = new stdClass();
-            $content->CustodialHistory->CustodialHistoryItem = [];
-
-            $histories = $this->db->getHistory($_SESSION['collections'][0]['view'], $object->res_id);
-            foreach ($histories as $history) {
-                if ($history->event_type != 'VIEW') {
-                    $content->CustodialHistory->CustodialHistoryItem[] = $this->getCustodialHistoryItem($history);
-                }
-            }
-
-            if (count($content->CustodialHistory->CustodialHistoryItem) == 0) {
-                unset($content->CustodialHistory);
-            }
-        }
-
-        return $content;
-    }
-
-    private function getManagement($letterbox = null)
-    {
-        $management = new stdClass();
-
-        if ($letterbox && $letterbox->type_id != 0) {
-            $docTypes = $this->db->getDocTypes($letterbox->type_id);
-
-            $management->AppraisalRule = new stdClass();
-            $management->AppraisalRule->Rule = new stdClass();
-            $management->AppraisalRule->Rule->value = $docTypes->retention_rule;
-            $management->AppraisalRule->StartDate = date("Y-m-d");
-            if ($docTypes->retention_final_disposition == "conservation") {
-                $management->AppraisalRule->FinalAction = "Keep";
-            } else {
-                $management->AppraisalRule->FinalAction = "Destroy";
-            }
-        }
-
-        if ((string) $this->xml->CONFIG->accessRuleCode) {
-            $management->AccessRule = new stdClass();
-            $management->AccessRule->Rule = new stdClass();
-            $management->AccessRule->Rule->value = (string)$this->xml->CONFIG->accessRuleCode;
-            $management->AccessRule->StartDate = date("Y-m-d");
-        }
-
-        return $management;
-    }
-
-    private function getBinaryDataObject($filePath, $id)
-    {
-        $binaryDataObject = new stdClass();
-
-        $pathInfo = pathinfo($filePath);
-
-        if ($id && $id != $pathInfo['filename']) {
-            $filename = $pathInfo['filename'] . '_' . $id . '.' . $pathInfo['extension'];
-        } else {
-            $filename = $pathInfo['filename'] . '_' . rand() . '.' . $pathInfo['extension'];
-        }
-
-        $binaryDataObject->id = $id;
-        $binaryDataObject->Uri = $filePath;
-        $binaryDataObject->MessageDigest = new stdClass();
-        $binaryDataObject->MessageDigest->value = hash_file('sha256', $filePath);
-        $binaryDataObject->MessageDigest->algorithm = "sha256";
-        $binaryDataObject->Size = filesize($filePath);
-
-
-        $binaryDataObject->Attachment = new stdClass();
-        $binaryDataObject->Attachment->filename = $filename;
-
-        $binaryDataObject->FileInfo = new stdClass();
-        $binaryDataObject->FileInfo->Filename = $filename;
-
-        $binaryDataObject->FormatIdentification = new stdClass();
-        $binaryDataObject->FormatIdentification->MimeType = mime_content_type($filePath);
-
-        return $binaryDataObject;
-    }
-
-    private function getKeyword($informations, $type = null)
-    {
-        $keyword = new stdClass();
-        $keyword->KeywordContent = new stdClass();
-
-        if ($type == "entity") {
-            $keyword->KeywordType = "corpname";
-            $keyword->KeywordContent->value = $informations->business_id;
-        } elseif ($informations->is_corporate_person == "Y") {
-            $keyword->KeywordType = "corpname";
-            $keyword->KeywordContent->value = $informations->society;
-        } else {
-            $keyword->KeywordType = "persname";
-            $keyword->KeywordContent->value = $informations->lastname . " " . $informations->firstname;
-        }
-
-        if (empty($keyword->KeywordContent->value)) {
-            return null;
-        }
-
-        return $keyword;
-    }
-
-    private function getAddresse($informations, $type = null)
-    {
-        $addressee = new stdClass();
-        if ($type == "entity") {
-            $addressee->Corpname = $informations->entity_label;
-            $addressee->Identifier = $informations->business_id;
-        } elseif ($informations->is_corporate_person == "Y") {
-            $addressee->Corpname = $informations->society;
-            $addressee->Identifier = $informations->contact_id;
-        } else {
-            $addressee->FirstName = $informations->firstname;
-            $addressee->BirthName = $informations->lastname;
-        }
-
-        if ((empty($addressee->Identifier) || empty($addressee->Corpname)) && (empty($addressee->FirstName) || empty($addressee->BirthName))) {
-            return null;
-        }
-
-        return $addressee;
-    }
-
-    private function getCustodialHistoryItem($history)
-    {
-        $date = new DateTime($history->event_date);
-
-        $custodialHistoryItem = new stdClass();
-        $custodialHistoryItem->value = $history->info;
-        $custodialHistoryItem->when = $date->format('Y-m-d');
-
-        return $custodialHistoryItem;
-    }
-
-    private function getEntity($entityId, $param)
-    {
-        $res = array_key_exists($entityId, $this->entities);
-        if ($res === false) {
-            $this->entities[$entityId] = $entity = $this->db->getEntity($entityId);
-        } else {
-            $entity = $this->entities[$entityId];
-        }
-
-        if (!$entity) {
-            return false;
-        }
-
-        if (!$entity->business_id) {
-            $businessId = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'business_id'
-            );
-
-            if (!$businessId) {
-                return false;
-            }
-
-            $entity->business_id = $businessId;
-        }
-
-        if (!$entity->archival_agreement) {
-            $archivalAgreement = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'archival_agreement'
-            );
-
-            if (!$archivalAgreement) {
-                return false;
-            }
-
-            $entity->archival_agreement = $archivalAgreement;
-        }
-
-        if (!$entity->archival_agency) {
-            $archivalAgency = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'archival_agency'
-            );
-
-            if (!$archivalAgency) {
-                return false;
-            }
-
-            $entity->archival_agency = $archivalAgency;
-        }
-
-        return $entity;
-    }
-
-    private function getEntityParent($parentId, $param)
-    {
-        $res = array_key_exists($parentId, $this->entities);
-        if ($res === false) {
-            $this->entities[$parentId] = $entity = $this->db->getEntity($parentId);
-        } else {
-            $entity = $this->entities[$parentId];
-        }
-
-        if (!$entity) {
-            return false;
-        }
-
-        $res = false;
-
-        if ($param == 'business_id') {
-            if (!$entity->business_id) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'business_id'
-                );
-            } else {
-                $res = $entity->business_id;
-            }
-        }
-
-        if ($param == 'archival_agreement') {
-            if (!$entity->archival_agreement) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'archival_agreement'
-                );
-            } else {
-                $res = $entity->archival_agreement;
-            }
-        }
-
-        if ($param == 'archival_agency') {
-            if (!$entity->archival_agency) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'archival_agency'
-                );
-            } else {
-                $res = $entity->archival_agency;
-            }
-        }
-
-        return $res;
-    }
-}
diff --git a/src/app/external/exportSeda/class/ArchiveTransferReply.php b/src/app/external/exportSeda/class/ArchiveTransferReply.php
deleted file mode 100644
index 957c7ec5244..00000000000
--- a/src/app/external/exportSeda/class/ArchiveTransferReply.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class ArchiveTransferReply {
-
-    private $db;
-    public function __construct()
-    {
-        $this->db = new RequestSeda();
-    }
-
-    public function receive($data, $resIds)
-    {
-        $messageObject = $this->getMessageObject($data);
-        $abstractMessage = new AbstractMessage();
-        //$this->db->insertMessage($data, "ArchiveTransferReply");
-        $abstractMessage->saveXml($messageObject,"ArchiveTransferReply", ".xml");
-
-        foreach ($resIds as $resId) {
-            $abstractMessage->addAttachment($messageObject->MessageIdentifier->value, $resId, $messageObject->MessageIdentifier->value.".xml", "xml", "Réponse au transfert",2);
-        }
-    }
-
-    private function getMessageObject($data)
-    {
-        $messageObject = new stdClass();
-
-        $messageObject->Comment = $data->comment;
-        $messageObject->Date = $data->date;
-        $messageObject->MessageIdentifier =  new stdClass();
-        $messageObject->MessageIdentifier->value = $data->messageIdentifier->value;
-
-        $messageObject->MessageRequestIdentifier =  new stdClass();
-        $messageObject->MessageRequestIdentifier->value = $data->messageRequestIdentifier->value;
-
-        $messageObject->ReplyCode = $data->replyCode->value . ' : ' . $data->replyCode->name;
-
-        $messageObject->ArchivalAgency = $this->getOrganisation($data->archivalAgency);
-        $messageObject->TransferringAgency = $this->getOrganisation($data->transferringAgency);
-
-        return $messageObject;
-    }
-
-    private function getOrganisation($data)
-    {
-        $organisationObject = new stdClass();
-        $organisationObject->Identifier = new stdClass();
-        $organisationObject->Identifier->value = $data->id;
-
-        $organisationObject->OrganizationDescriptiveMetadata = new stdClass();
-        $organisationObject->OrganizationDescriptiveMetadata->Name = $data->name;
-        $organisationObject->OrganizationDescriptiveMetadata->LegalClassification = $data->legalClassification;
-
-        if ($data->address) {
-            $organisationObject->OrganizationDescriptiveMetadata->Address = $this->getAddress($data->address);
-        }
-
-        if ($data->communication) {
-            $organisationObject->OrganizationDescriptiveMetadata->Communication = $this->getCommunication($data->communication);
-        }
-
-        if ($data->contact) {
-            $organisationObject->OrganizationDescriptiveMetadata->Contact = $this->getContact($data->contact);
-        }
-
-        return $organisationObject;
-    }
-
-    private function getContact($data)
-    {
-        $listContact = [];
-        foreach ($data as $contact) {
-            $tmpContact =  new stdClass();
-            $tmpContact->DepartmentName = $contact->departmentName;
-            $tmpContact->PersonName = $contact->personName;
-
-            if ($contact->address){
-                $tmpContact->Address = [];
-                $tmpContact->Address = $this->getAddress($contact->address);
-            }
-
-            if ($contact->communication) {
-                $tmpContact->Communication = [];
-                $tmpContact->Communication = $this->getCommunication($contact->communication);
-            }
-            $listContact[] = $tmpContact;
-        }
-        return $listContact;
-    }
-
-    private function getAddress($data)
-    {
-        $listAddress = [];
-        foreach ($data as $address) {
-            $tmpAddress = new stdClass();
-            $tmpAddress->CityName = $address->cityName;
-            $tmpAddress->Country = $address->country;
-            $tmpAddress->PostCode = $address->postCode;
-            $tmpAddress->StreetName = $address->streetName;
-
-            $listAddress[] = $tmpAddress;
-        }
-        return $listAddress;
-    }
-
-    private function getCommunication($data)
-    {
-        $listCommunication = [];
-        foreach ($data as $communication) {
-            $tmpCommunication = new stdClass();
-            $tmpCommunication->Channel = $communication->channel;
-
-            if ($communication->completeNumber) {
-                $tmpCommunication->value = $communication->completeNumber;
-            } else {
-                $tmpCommunication->value = $communication->URIID;
-            }
-            $listCommunication[] = $tmpCommunication;
-        }
-        return $listCommunication;
-    }
-}
diff --git a/src/app/external/exportSeda/controllers/SendMessageController.php b/src/app/external/exportSeda/controllers/SendMessageController.php
index 6865b052aa8..679c41191e7 100755
--- a/src/app/external/exportSeda/controllers/SendMessageController.php
+++ b/src/app/external/exportSeda/controllers/SendMessageController.php
@@ -15,7 +15,6 @@
 namespace ExportSeda\controllers;
 
 use SrcCore\models\CoreConfigModel;
-use exportSeda\models\ArchiveTransfer;
 
 class SendMessageController
 {
@@ -44,7 +43,7 @@ class SendMessageController
         $messageObject = $aArgs['messageObject'];
         $type          = $aArgs['type'];
 
-        $seda2Message = SendMessageController::initMessage(new \stdClass);
+        $seda2Message = self::initMessage(new \stdClass);
 
         $seda2Message->MessageIdentifier->value = $messageObject->messageIdentifier;
         $seda2Message->ArchivalAgreement->value = $messageObject->archivalAgreement;
@@ -102,13 +101,14 @@ class SendMessageController
 
         // TODO : Externaliser la fonction de création du xml final
         $DOMTemplate = new \DOMDocument();
-        $DOMTemplate->load('modules/export_seda/resources/'.$type.'.xml');
+        $DOMTemplate->load('src/app/external/exportSeda/resources/'.$type.'.xml');
         $DOMTemplateProcessor = new DOMTemplateProcessorController($DOMTemplate);
         $DOMTemplateProcessor->setSource($type, $seda2Message);
         $DOMTemplateProcessor->merge();
         $DOMTemplateProcessor->removeEmptyNodes();
 
         file_put_contents($tmpPath . $seda2Message->MessageIdentifier->value . ".xml", $DOMTemplate->saveXML());
+        var_dump(file_get_contents($tmpPath . $seda2Message->MessageIdentifier->value . ".xml")); exit();
 
         $filename = self::generateZip($seda2Message, $tmpPath);
 
diff --git a/src/app/external/exportSeda/models/Acknowledgement.php b/src/app/external/exportSeda/models/Acknowledgement.php
deleted file mode 100644
index a4546c8bf9d..00000000000
--- a/src/app/external/exportSeda/models/Acknowledgement.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class Acknowledgement {
-
-	public function __construct()
-	{
-	}
-
-	public function receive($data, $resIds)
-	{
-	    $messageObject = $this->getMessageObject($data);
-	    $abstractMessage = new AbstractMessage();
-        $abstractMessage->saveXml($messageObject,"Acknowledgement", ".xml");
-
-		foreach ($resIds as $resId) {
-            $abstractMessage->addAttachment($messageObject->MessageIdentifier->value, $resId, $messageObject->MessageIdentifier->value.".xml", "xml", "Accusé de réception",1);
-        }
-
-        return $messageObject;
-	}
-
-    private function getMessageObject($data)
-    {
-        $messageObject = new stdClass();
-
-        $messageObject->Comment = $data->comment;
-        $messageObject->Date = $data->date;
-        $messageObject->MessageIdentifier = $data->messageIdentifier;
-        $messageObject->MessageReceivedIdentifier = $data->messageReceivedIdentifier;
-
-        $messageObject->Receiver = $this->getOrganisation($data->receiver);
-        $messageObject->Sender = $this->getOrganisation($data->sender);
-
-        return $messageObject;
-    }
-
-    private function getOrganisation($data)
-    {
-        $organisationObject = new stdClass();
-        $organisationObject->Identifier = new stdClass();
-        $organisationObject->Identifier->value = $data->id;
-
-        $organisationObject->OrganizationDescriptiveMetadata = new stdClass();
-        $organisationObject->OrganizationDescriptiveMetadata->Name = $data->name;
-        $organisationObject->OrganizationDescriptiveMetadata->LegalClassification = $data->legalClassification;
-
-        if ($data->address) {
-            $organisationObject->OrganizationDescriptiveMetadata->Address = $this->getAddress($data->address);
-        }
-
-        if ($data->communication) {
-            $organisationObject->OrganizationDescriptiveMetadata->Communication = $this->getCommunication($data->communication);
-        }
-
-        if ($data->contact) {
-            $organisationObject->OrganizationDescriptiveMetadata->Contact = $this->getContact($data->contact);
-        }
-
-        return $organisationObject;
-    }
-
-    private function getContact($data)
-    {
-        $listContact = [];
-        foreach ($data as $contact) {
-            $tmpContact =  new stdClass();
-            $tmpContact->DepartmentName = $contact->departmentName;
-            $tmpContact->PersonName = $contact->personName;
-
-            if ($contact->address){
-                $tmpContact->Address = [];
-                $tmpContact->Address = $this->getAddress($contact->address);
-            }
-
-            if ($contact->communication) {
-                $tmpContact->Communication = [];
-                $tmpContact->Communication = $this->getCommunication($contact->communication);
-            }
-            $listContact[] = $tmpContact;
-        }
-        return $listContact;
-    }
-
-    private function getAddress($data)
-    {
-	    $listAddress = [];
-        foreach ($data as $address) {
-            $tmpAddress = new stdClass();
-            $tmpAddress->CityName = $address->cityName;
-            $tmpAddress->Country = $address->country;
-            $tmpAddress->PostCode = $address->postCode;
-            $tmpAddress->StreetName = $address->streetName;
-
-            $listAddress[] = $tmpAddress;
-        }
-        return $listAddress;
-    }
-
-    private function getCommunication($data)
-    {
-        $listCommunication = [];
-        foreach ($data as $communication) {
-            $tmpCommunication = new stdClass();
-            $tmpCommunication->Channel = $communication->channel;
-
-            if ($communication->completeNumber) {
-                $tmpCommunication->value = $communication->completeNumber;
-            } else {
-                $tmpCommunication->value = $communication->URIID;
-            }
-            $listCommunication[] = $tmpCommunication;
-        }
-        return $listCommunication;
-    }
-}
diff --git a/src/app/external/exportSeda/models/ArchiveTransfer.php b/src/app/external/exportSeda/models/ArchiveTransfer.php
deleted file mode 100644
index 87de4f2a7a5..00000000000
--- a/src/app/external/exportSeda/models/ArchiveTransfer.php
+++ /dev/null
@@ -1,876 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../RequestSeda.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class ArchiveTransfer
-{
-    private $db;
-    private $abstractMessage;
-    private $externalLink;
-    private $xml;
-    protected $entities;
-
-    public function __construct()
-    {
-        $this->db = new RequestSeda();
-        $this->abstractMessage = new AbstractMessage();
-        $_SESSION['error'] = "";
-
-        $getXml = false;
-        $path = '';
-        if (file_exists(
-            $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-            . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-                . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-                . DIRECTORY_SEPARATOR . 'export_seda'. DIRECTORY_SEPARATOR . 'xml'
-                . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        } elseif (file_exists(
-            $_SESSION['config']['corepath'] . 'modules'
-            . DIRECTORY_SEPARATOR . 'export_seda'.  DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'config.xml'
-        )) {
-            $path = $_SESSION['config']['corepath'] . 'modules' . DIRECTORY_SEPARATOR . 'export_seda'
-                . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'config.xml';
-            $getXml = true;
-        }
-
-        if ($getXml) {
-            $this->xml = simplexml_load_file($path);
-        }
-
-        $this->entities = [];
-    }
-
-    public function receive($listResId)
-    {
-        if (!$listResId) {
-            return false;
-        }
-
-        $messageObject = new stdClass();
-        $messageObject = $this->initMessage($messageObject);
-
-        if (!empty($_SESSION['error'])) {
-            return;
-        }
-
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[] = $this->getArchiveUnit(
-            "RecordGrp",
-            null,
-            null,
-            'group_1',
-            null,
-            null
-        );
-
-        $result = $startDate = $endDate = '';
-        $i = 1;
-        foreach ($listResId as $resId) {
-            $this->externalLink = false;
-
-            if (!empty($result)) {
-                $result .= ',';
-            }
-            $result .= $resId;
-
-            $letterbox = $this->db->getLetter($resId);
-            $attachments = $this->db->getAttachments($letterbox->res_id);
-            $notes = $this->db->getNotes($letterbox->res_id);
-            $mails = $this->db->getMails($letterbox->res_id);
-            $links = $this->db->getLinks($letterbox->res_id);
-
-            $relatedObjectReference = [];
-            if (is_array($links)) {
-                foreach ($links as $link) {
-                    if (!array_search($link, $listResId)) {
-                        $relatedObjectReference[$link] = false;
-                    } else {
-                        $relatedObjectReference[$link] = true;
-                    }
-                }
-            } else {
-                if (!array_search($links, $listResId)) {
-                    $relatedObjectReference[$links] = false;
-                } else {
-                    $relatedObjectReference[$links] = true;
-                }
-            }
-
-            $archiveUnitId = 'letterbox_' . $resId;
-            if ($letterbox->filename) {
-                $docServers = $this->db->getDocServer($letterbox->docserver_id);
-                $uri = str_replace("##", DIRECTORY_SEPARATOR, $letterbox->path);
-                $uri = str_replace("#", DIRECTORY_SEPARATOR, $uri);
-                $uri .= $letterbox->filename;
-                $filePath = $docServers->path_template . $uri;
-
-                if (!file_exists($filePath)) {
-                    $_SESSION['error'] = _ERROR_FILE_NOT_EXIST;
-                    return;
-                }
-
-                $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                    "File",
-                    $letterbox,
-                    $attachments,
-                    $archiveUnitId,
-                    $letterbox->res_id,
-                    $relatedObjectReference
-                );
-
-                $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                    $filePath,
-                    $_SESSION['collections'][0]['table'] . '_' . $letterbox->res_id
-                );
-            } else {
-                $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                    "File",
-                    $letterbox,
-                    null,
-                    null,
-                    null,
-                    $relatedObjectReference
-                );
-            }
-
-            if ($attachments) {
-                $j = 1;
-                foreach ($attachments as $attachment) {
-                    $docServers = $this->db->getDocServer($attachment->docserver_id);
-
-                    $uri = str_replace("##", DIRECTORY_SEPARATOR, $attachment->path);
-                    $uri = str_replace("#", DIRECTORY_SEPARATOR, $uri);
-                    $uri .= $attachment->filename;
-
-                    $filePath = $docServers->path_template . $uri;
-                    if ($attachment->attachment_type == "signed_response") {
-                        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Response",
-                            $attachment,
-                            null,
-                            'attachment_'. $i. '_'. $j,
-                            "response_" . $attachment->res_id
-//                            $archiveUnitId
-                        );
-
-                        $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                            $filePath,
-                            $_SESSION['collections'][1]['table'] . '_'.  $attachment->res_id
-                        );
-                        $j++;
-                    } else {
-                        $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject(
-                            $filePath,
-                            $_SESSION['collections'][1]['table']. '_'.  $attachment->res_id
-                        );
-                    }
-                }
-            }
-
-            if ($notes) {
-                foreach ($notes as $note) {
-                    $id = 'note_'.$note->id;
-                    $filePath = $_SESSION['config']['tmppath']. DIRECTORY_SEPARATOR. $id. '.pdf';
-
-                    $this->abstractMessage->createPDF($id, $note->note_text);
-                    $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject($filePath, $id);
-                }
-            }
-
-            if ($mails) {
-                foreach ($mails as $mail) {
-                    $id = 'email_'.$mail->email_id;
-                    $filePath = $_SESSION['config']['tmppath']. DIRECTORY_SEPARATOR. $id. '.pdf';
-                    $body = str_replace('###', ';', $mail->email_body);
-                    $data = 'email n°' . $mail->email_id . '
-' .'de ' . $mail->sender_email . '
-' . 'à ' . $mail->to_list . '
-' . 'objet : ' . $mail->email_object . '
-' . 'corps : ' . strip_tags(html_entity_decode($body));
-
-                    $this->abstractMessage->createPDF($id, $data);
-                    $messageObject->DataObjectPackage->BinaryDataObject[] = $this->getBinaryDataObject($filePath, $id);
-                }
-            }
-
-            $format = 'Y-m-d H:i:s.u';
-            $creationDate = DateTime::createFromFormat($format, $letterbox->creation_date);
-            if ($startDate == '') {
-                $startDate = $creationDate;
-            } elseif ( date_diff($startDate, $creationDate) > 0 ) {
-                $startDate = $creationDate;
-            }
-
-            $modificationDate = DateTime::createFromFormat($format, $letterbox->modification_date);
-            if ($endDate == '') {
-                $endDate = $modificationDate;
-            } elseif ( date_diff($endDate, $modificationDate) < 0) {
-                $endDate = $modificationDate;
-            }
-
-            $i++;
-        }
-
-        $originator = "";
-        foreach ($messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit as $archiveUnit) {
-            if (!empty($archiveUnit->Content->OriginatingAgency->Identifier->value)) {
-                $originator = $archiveUnit->Content->OriginatingAgency->Identifier->value;
-                break;
-            }
-        }
-
-        if (!empty($originator)) {
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency = new stdClass();
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency->Identifier = new stdClass();
-            $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->OriginatingAgency->Identifier->value = $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->ArchiveUnit[0]->Content->OriginatingAgency->Identifier->value;
-        } else {
-            $_SESSION['error'] = _ERROR_ORIGINATOR_EMPTY;
-        }
-
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->StartDate = $startDate->format('Y-m-d');
-        $messageObject->DataObjectPackage->DescriptiveMetadata->ArchiveUnit[0]->Content->EndDate = $endDate->format('Y-m-d');
-
-        $messageSaved = $this->saveMessage($messageObject);
-
-        foreach ($listResId as $resId) {
-            $this->db->insertUnitIdentifier($messageSaved['messageId'], "res_letterbox", $resId);
-        }
-
-        return $result;
-    }
-
-    public function deleteMessage($listResId)
-    {
-        if (!$listResId) {
-            return false;
-        }
-
-        $resIds = [];
-        if (!is_array($listResId)) {
-            $resIds[] = $listResId;
-        } else {
-            $resIds = $listResId;
-        }
-
-
-        foreach ($resIds as $resId) {
-            $unitIdentifier = $this->db->getUnitIdentifierByResId($resId);
-            $this->db->deleteMessage($unitIdentifier->message_id);
-            $this->db->deleteUnitIdentifier($resId);
-        }
-
-        return true;
-    }
-
-    private function saveMessage($messageObject)
-    {
-        $data = new stdClass();
-
-        $data->messageId                             = $messageObject->MessageIdentifier->value;
-        $data->date                                  = $messageObject->Date;
-
-        $data->MessageIdentifier                     = new stdClass();
-        $data->MessageIdentifier->value              = $messageObject->MessageIdentifier->value;
-
-        $data->TransferringAgency                    = new stdClass();
-        $data->TransferringAgency->Identifier        = new stdClass();
-        $data->TransferringAgency->Identifier->value = $messageObject->TransferringAgency->Identifier->value;
-
-        $data->ArchivalAgency                        = new stdClass();
-        $data->ArchivalAgency->Identifier            = new stdClass();
-        $data->ArchivalAgency->Identifier->value     = $messageObject->ArchivalAgency->Identifier->value;
-
-        $data->ArchivalAgreement                     = new stdClass();
-        $data->ArchivalAgreement->value              = $messageObject->ArchivalAgreement->value;
-
-        $data->ReplyCode                             = $messageObject->ReplyCode;
-
-        $aArgs                                       = [];
-        $aArgs['fullMessageObject']                  = $messageObject;
-        $aArgs['SenderOrgNAme']                      = "";
-        $aArgs['RecipientOrgNAme']                   = "";
-
-        $messageId = $this->db->insertMessage($data, "ArchiveTransfer", $aArgs);
-
-        return $messageId;
-    }
-
-    private function initMessage($messageObject)
-    {
-
-        $this->directoryMessage = (string) $this->xml->CONFIG->directoryMessage;
-
-        if (!$this->directoryMessage || !is_dir($this->directoryMessage)) {
-            $_SESSION['error'] .= _DIRECTORY_MESSAGE_REQUIRED;
-            return;
-        }
-
-        $date = new DateTime;
-        $messageObject->Date = $date->format(DateTime::ATOM);
-        $messageObject->MessageIdentifier = new stdClass();
-        $messageObject->MessageIdentifier->value = $_SESSION['user']['UserId'] . "-" . date('Ymd-His');
-
-        $messageObject->TransferringAgency = new stdClass();
-        $messageObject->TransferringAgency->Identifier = new stdClass();
-
-        $messageObject->ArchivalAgency = new stdClass();
-        $messageObject->ArchivalAgency->Identifier = new stdClass();
-
-        $messageObject->ArchivalAgreement = new stdClass();
-
-        foreach ($_SESSION['user']['entities'] as $entity) {
-            $res = array_key_exists($entity['ENTITY_ID'], $this->entities);
-            if ($res === false) {
-                $this->entities[$entity['ENTITY_ID']] = $entity = $this->db->getEntity($entity['ENTITY_ID']);
-            } else {
-                $entity = $this->entities[$entity['ENTITY_ID']];
-            }
-
-            if ($entity) {
-                if (!(string) $this->xml->CONFIG->senderOrgRegNumber) {
-                    $_SESSION['error'] .= _TRANSFERRING_AGENCY_SIREN_REQUIRED;
-                }
-
-                if (!$entity->archival_agency) {
-                    $_SESSION['error'] .= _ARCHIVAL_AGENCY_SIREN_REQUIRED;
-                }
-
-                if (!$entity->archival_agreement) {
-                    $_SESSION['error'] .= _ARCHIVAL_AGREEMENT_REQUIRED;
-                }
-
-                if (!empty($_SESSION['error'])) {
-                    return;
-                }
-
-                $messageObject->TransferringAgency->Identifier->value = (string) $this->xml->CONFIG->senderOrgRegNumber;
-                $messageObject->ArchivalAgency->Identifier->value = $entity->archival_agency;
-                $messageObject->ArchivalAgreement->value = $entity->archival_agreement;
-            } else {
-                $_SESSION['error'] .= _NO_ENTITIES;
-            }
-        }
-
-        $messageObject->DataObjectPackage = new stdClass();
-        $messageObject->DataObjectPackage->BinaryDataObject = [];
-        $messageObject->DataObjectPackage->DescriptiveMetadata = new stdClass();
-        $messageObject->DataObjectPackage->ManagementMetadata = new stdClass();
-
-        return $messageObject;
-    }
-
-    private function getArchiveUnit(
-        $type,
-        $object = null,
-        $attachments = null,
-        $archiveUnitId = null,
-        $dataObjectReferenceId = null,
-        $relatedObjectReference = null
-    ) {
-        $archiveUnit = new stdClass();
-
-        if ($archiveUnitId) {
-            $archiveUnit->id = $archiveUnitId;
-        } else {
-            $archiveUnit->id = uniqid();
-        }
-
-        if (isset($object)) {
-            if ($relatedObjectReference) {
-                $archiveUnit->Content = $this->getContent($type, $object, $relatedObjectReference);
-            } else {
-                $archiveUnit->Content = $this->getContent($type, $object);
-            }
-
-            $archiveUnit->Management = $this->getManagement($object);
-        } else {
-            $archiveUnit->Content = $this->getContent($type);
-            $archiveUnit->Management = $this->getManagement();
-        }
-
-
-        if ($dataObjectReferenceId) {
-            $archiveUnit->DataObjectReference = new stdClass();
-            if ($type == 'File') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = $_SESSION['collections'][0]['table'] . '_' .$dataObjectReferenceId;
-            } elseif ($type == 'Note') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = 'note_' .$dataObjectReferenceId;
-            } elseif ($type == 'Email') {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = 'email_' .$dataObjectReferenceId;
-            } else {
-                $archiveUnit->DataObjectReference->DataObjectReferenceId = $_SESSION['collections'][1]['table'] . '_' .$dataObjectReferenceId;
-            }
-
-        }
-
-        $archiveUnit->ArchiveUnit = [];
-        if ($attachments) {
-            $i = 1;
-            foreach ($attachments as $attachment) {
-                if ($attachment->res_id_master == $object->res_id) {
-                    if ($attachment->attachment_type != "signed_response") {
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Item",
-                            $attachment,
-                            null,
-                            $archiveUnitId. '_attachment_' . $i,
-                            $attachment->res_id
-                        );
-                    }
-                }
-                $i++;
-            }
-        }
-
-        if ($object->res_id) {
-            if ($type != 'Note' && $type != 'Email') {
-                $notes = $this->db->getNotes($object->res_id);
-                if ($notes) {
-                    $i = 1;
-                    foreach ($notes as $note) {
-                        $note->title = 'Note n° ' . $note->id;
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Note",
-                            $note,
-                            null,
-                            $archiveUnitId . '_note_' . $i,
-                            $note->id
-                        );
-                        $i++;
-                    }
-                }
-            }
-
-            if ($type != 'Email' && $type != 'Note') {
-                $emails = $this->db->getMails($object->res_id);
-                if ($emails) {
-                    $i = 1;
-                    foreach ($emails as $email) {
-                        $email->title = 'Email n° ' . $email->email_id;
-                        $archiveUnit->ArchiveUnit[] = $this->getArchiveUnit(
-                            "Email",
-                            $email,
-                            null,
-                            $archiveUnitId . '_email_' . $i,
-                            $email->email_id
-                        );
-                        $i++;
-                    }
-                }
-            }
-        }
-        if (count($archiveUnit->ArchiveUnit) == 0) {
-            unset($archiveUnit->ArchiveUnit);
-        }
-
-        return $archiveUnit;
-    }
-
-    private function getContent($type, $object = null, $relatedObjectReference = null)
-    {
-
-        $content = new stdClass();
-
-        switch ($type) {
-            case 'RecordGrp':
-                $content->DescriptionLevel = $type;
-                $content->Title = [];
-                $content->DocumentType = 'Dossier';
-
-                return $content;
-                break;
-            case 'File':
-                $content->DescriptionLevel = $type;
-
-                $sentDate = new DateTime($object->doc_date);
-                $receivedDate = new DateTime($object->admission_date);
-                $acquiredDate = new DateTime($object->creaction_date);
-                $content->SentDate = $sentDate->format(DateTime::ATOM);
-                $content->ReceivedDate = $receivedDate->format(DateTime::ATOM);
-                $content->AcquiredDate = $acquiredDate->format(DateTime::ATOM);
-
-                $content->Addressee = [];
-                $content->Keyword = [];
-
-                $keyword = $addressee = $entity = "";
-
-                if ($object->destination) {
-                    $res = array_key_exists($object->destination, $this->entities);
-                    if ($res === false) {
-                        $this->entities[$object->destination] = $entity = $this->db->getEntity($object->destination);
-                    } else {
-                        $entity = $this->entities[$object->destination];
-                    }
-                }
-
-                if ($object->exp_contact_id) {
-                    $contact = $this->db->getContact($object->exp_contact_id);
-                    $keyword = $this->getKeyword($contact);
-                    $addressee = $this->getAddresse($entity, "entity");
-                } elseif ($object->dest_contact_id) {
-                    $contact = $this->db->getContact($object->dest_contact_id);
-                    $addressee = $this->getAddresse($contact);
-                    $keyword = $this->getKeyword($entity, "entity");
-                } elseif ($object->exp_user_id) {
-                    $user = $this->db->getUserInformation($object->exp_user_id);
-                    $keyword = $this->getKeyword($user);
-                    $addressee = $this->getAddresse($entity, "entity");
-                }
-
-                if (!empty($keyword)) {
-                    $content->Keyword[] = $keyword;
-                }
-
-                if (!empty($addressee)) {
-                    $content->Addressee[] = $addressee;
-                }
-
-                $content->Source = '';
-
-                $content->DocumentType = $object->type_label;
-                $content->OriginatingAgencyArchiveUnitIdentifier = $object->alt_identifier;
-                $content->OriginatingSystemId = $object->res_id;
-
-                $content->Title = [];
-                $content->Title[] = $object->subject;
-                break;
-            case 'Item':
-            case 'Attachment':
-            case 'Response':
-            case 'Note':
-            case 'Email':
-                $content->DescriptionLevel = "Item";
-                $content->Title = [];
-                $content->Title[] = $object->title;
-
-                if ($type == "Item") {
-                    $content->DocumentType = "Pièce jointe";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Note") {
-                    $content->DocumentType = "Note";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Email") {
-                    $content->DocumentType = "Courriel";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                } elseif ($type == "Response") {
-                    $content->DocumentType = "Réponse";
-                    $date = new DateTime($object->creation_date);
-                    $content->CreatedDate = $date->format('Y-m-d');
-                }
-
-                break;
-        }
-
-        if (isset($relatedObjectReference)) {
-            $content->RelatedObjectReference = new stdClass();
-            $content->RelatedObjectReference->References = [];
-
-            foreach ($relatedObjectReference as $key => $value) {
-                $reference = new stdClass();
-                if ($value) {
-                    $reference->ArchiveUnitRefId = 'letterbox_' . $key;
-                    $content->RelatedObjectReference->References[] = $reference;
-                } else {
-                    $destination = $this->db->getDestinationLetter($key);
-                    if (isset($destination)) {
-                        $res = array_key_exists($destination, $this->entities);
-                        if ($res === false) {
-                            $this->entities[$destination] = $entity = $this->db->getEntity($destination);
-                        } else {
-                            $entity = $this->entities[$destination];
-                        }
-
-                        $reference->RepositoryArchiveUnitPID = 'originator:' . $entity->business_id . ':' . $key;
-                        $content->RelatedObjectReference->References[] = $reference;
-                    }
-                }
-            }
-
-        }
-
-        if (isset($object->destination)) {
-            $content->OriginatingAgency = new stdClass();
-            $content->OriginatingAgency->Identifier = new stdClass();
-
-            $res = array_key_exists($object->destination, $this->entities);
-            if ($res === false) {
-                $this->entities[$object->destination] = $entity = $this->db->getEntity($object->destination);
-            } else {
-                $entity = $this->entities[$object->destination];
-            }
-            $content->OriginatingAgency->Identifier->value = $entity->business_id;
-
-            if (empty($content->OriginatingAgency->Identifier->value)) {
-                unset($content->OriginatingAgency);
-            }
-        }
-
-        if (isset($object->res_id)) {
-            $content->CustodialHistory = new stdClass();
-            $content->CustodialHistory->CustodialHistoryItem = [];
-
-            $histories = $this->db->getHistory($_SESSION['collections'][0]['view'], $object->res_id);
-            foreach ($histories as $history) {
-                if ($history->event_type != 'VIEW') {
-                    $content->CustodialHistory->CustodialHistoryItem[] = $this->getCustodialHistoryItem($history);
-                }
-            }
-
-            if (count($content->CustodialHistory->CustodialHistoryItem) == 0) {
-                unset($content->CustodialHistory);
-            }
-        }
-
-        return $content;
-    }
-
-    private function getManagement($letterbox = null)
-    {
-        $management = new stdClass();
-
-        if ($letterbox && $letterbox->type_id != 0) {
-            $docTypes = $this->db->getDocTypes($letterbox->type_id);
-
-            $management->AppraisalRule = new stdClass();
-            $management->AppraisalRule->Rule = new stdClass();
-            $management->AppraisalRule->Rule->value = $docTypes->retention_rule;
-            $management->AppraisalRule->StartDate = date("Y-m-d");
-            if ($docTypes->retention_final_disposition == "conservation") {
-                $management->AppraisalRule->FinalAction = "Keep";
-            } else {
-                $management->AppraisalRule->FinalAction = "Destroy";
-            }
-        }
-
-        if ((string) $this->xml->CONFIG->accessRuleCode) {
-            $management->AccessRule = new stdClass();
-            $management->AccessRule->Rule = new stdClass();
-            $management->AccessRule->Rule->value = (string)$this->xml->CONFIG->accessRuleCode;
-            $management->AccessRule->StartDate = date("Y-m-d");
-        }
-
-        return $management;
-    }
-
-    private function getBinaryDataObject($filePath, $id)
-    {
-        $binaryDataObject = new stdClass();
-
-        $pathInfo = pathinfo($filePath);
-
-        if ($id && $id != $pathInfo['filename']) {
-            $filename = $pathInfo['filename'] . '_' . $id . '.' . $pathInfo['extension'];
-        } else {
-            $filename = $pathInfo['filename'] . '_' . rand() . '.' . $pathInfo['extension'];
-        }
-
-        $binaryDataObject->id = $id;
-        $binaryDataObject->Uri = $filePath;
-        $binaryDataObject->MessageDigest = new stdClass();
-        $binaryDataObject->MessageDigest->value = hash_file('sha256', $filePath);
-        $binaryDataObject->MessageDigest->algorithm = "sha256";
-        $binaryDataObject->Size = filesize($filePath);
-
-
-        $binaryDataObject->Attachment = new stdClass();
-        $binaryDataObject->Attachment->filename = $filename;
-
-        $binaryDataObject->FileInfo = new stdClass();
-        $binaryDataObject->FileInfo->Filename = $filename;
-
-        $binaryDataObject->FormatIdentification = new stdClass();
-        $binaryDataObject->FormatIdentification->MimeType = mime_content_type($filePath);
-
-        return $binaryDataObject;
-    }
-
-    private function getKeyword($informations, $type = null)
-    {
-        $keyword = new stdClass();
-        $keyword->KeywordContent = new stdClass();
-
-        if ($type == "entity") {
-            $keyword->KeywordType = "corpname";
-            $keyword->KeywordContent->value = $informations->business_id;
-        } elseif ($informations->is_corporate_person == "Y") {
-            $keyword->KeywordType = "corpname";
-            $keyword->KeywordContent->value = $informations->society;
-        } else {
-            $keyword->KeywordType = "persname";
-            $keyword->KeywordContent->value = $informations->lastname . " " . $informations->firstname;
-        }
-
-        if (empty($keyword->KeywordContent->value)) {
-            return null;
-        }
-
-        return $keyword;
-    }
-
-    private function getAddresse($informations, $type = null)
-    {
-        $addressee = new stdClass();
-        if ($type == "entity") {
-            $addressee->Corpname = $informations->entity_label;
-            $addressee->Identifier = $informations->business_id;
-        } elseif ($informations->is_corporate_person == "Y") {
-            $addressee->Corpname = $informations->society;
-            $addressee->Identifier = $informations->contact_id;
-        } else {
-            $addressee->FirstName = $informations->firstname;
-            $addressee->BirthName = $informations->lastname;
-        }
-
-        if ((empty($addressee->Identifier) || empty($addressee->Corpname)) && (empty($addressee->FirstName) || empty($addressee->BirthName))) {
-            return null;
-        }
-
-        return $addressee;
-    }
-
-    private function getCustodialHistoryItem($history)
-    {
-        $date = new DateTime($history->event_date);
-
-        $custodialHistoryItem = new stdClass();
-        $custodialHistoryItem->value = $history->info;
-        $custodialHistoryItem->when = $date->format('Y-m-d');
-
-        return $custodialHistoryItem;
-    }
-
-    private function getEntity($entityId, $param)
-    {
-        $res = array_key_exists($entityId, $this->entities);
-        if ($res === false) {
-            $this->entities[$entityId] = $entity = $this->db->getEntity($entityId);
-        } else {
-            $entity = $this->entities[$entityId];
-        }
-
-        if (!$entity) {
-            return false;
-        }
-
-        if (!$entity->business_id) {
-            $businessId = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'business_id'
-            );
-
-            if (!$businessId) {
-                return false;
-            }
-
-            $entity->business_id = $businessId;
-        }
-
-        if (!$entity->archival_agreement) {
-            $archivalAgreement = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'archival_agreement'
-            );
-
-            if (!$archivalAgreement) {
-                return false;
-            }
-
-            $entity->archival_agreement = $archivalAgreement;
-        }
-
-        if (!$entity->archival_agency) {
-            $archivalAgency = $this->getEntityParent(
-                $entity->parent_entity_id,
-                'archival_agency'
-            );
-
-            if (!$archivalAgency) {
-                return false;
-            }
-
-            $entity->archival_agency = $archivalAgency;
-        }
-
-        return $entity;
-    }
-
-    private function getEntityParent($parentId, $param)
-    {
-        $res = array_key_exists($parentId, $this->entities);
-        if ($res === false) {
-            $this->entities[$parentId] = $entity = $this->db->getEntity($parentId);
-        } else {
-            $entity = $this->entities[$parentId];
-        }
-
-        if (!$entity) {
-            return false;
-        }
-
-        $res = false;
-
-        if ($param == 'business_id') {
-            if (!$entity->business_id) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'business_id'
-                );
-            } else {
-                $res = $entity->business_id;
-            }
-        }
-
-        if ($param == 'archival_agreement') {
-            if (!$entity->archival_agreement) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'archival_agreement'
-                );
-            } else {
-                $res = $entity->archival_agreement;
-            }
-        }
-
-        if ($param == 'archival_agency') {
-            if (!$entity->archival_agency) {
-                $res = $this->getEntityParent(
-                    $entity->parent_entity_id,
-                    'archival_agency'
-                );
-            } else {
-                $res = $entity->archival_agency;
-            }
-        }
-
-        return $res;
-    }
-}
diff --git a/src/app/external/exportSeda/models/ArchiveTransferReply.php b/src/app/external/exportSeda/models/ArchiveTransferReply.php
deleted file mode 100644
index 957c7ec5244..00000000000
--- a/src/app/external/exportSeda/models/ArchiveTransferReply.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2017 Maarch
-*
-*   This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-require_once __DIR__ . DIRECTORY_SEPARATOR .'../DOMTemplateProcessor.php';
-require_once __DIR__ . '/AbstractMessage.php';
-
-class ArchiveTransferReply {
-
-    private $db;
-    public function __construct()
-    {
-        $this->db = new RequestSeda();
-    }
-
-    public function receive($data, $resIds)
-    {
-        $messageObject = $this->getMessageObject($data);
-        $abstractMessage = new AbstractMessage();
-        //$this->db->insertMessage($data, "ArchiveTransferReply");
-        $abstractMessage->saveXml($messageObject,"ArchiveTransferReply", ".xml");
-
-        foreach ($resIds as $resId) {
-            $abstractMessage->addAttachment($messageObject->MessageIdentifier->value, $resId, $messageObject->MessageIdentifier->value.".xml", "xml", "Réponse au transfert",2);
-        }
-    }
-
-    private function getMessageObject($data)
-    {
-        $messageObject = new stdClass();
-
-        $messageObject->Comment = $data->comment;
-        $messageObject->Date = $data->date;
-        $messageObject->MessageIdentifier =  new stdClass();
-        $messageObject->MessageIdentifier->value = $data->messageIdentifier->value;
-
-        $messageObject->MessageRequestIdentifier =  new stdClass();
-        $messageObject->MessageRequestIdentifier->value = $data->messageRequestIdentifier->value;
-
-        $messageObject->ReplyCode = $data->replyCode->value . ' : ' . $data->replyCode->name;
-
-        $messageObject->ArchivalAgency = $this->getOrganisation($data->archivalAgency);
-        $messageObject->TransferringAgency = $this->getOrganisation($data->transferringAgency);
-
-        return $messageObject;
-    }
-
-    private function getOrganisation($data)
-    {
-        $organisationObject = new stdClass();
-        $organisationObject->Identifier = new stdClass();
-        $organisationObject->Identifier->value = $data->id;
-
-        $organisationObject->OrganizationDescriptiveMetadata = new stdClass();
-        $organisationObject->OrganizationDescriptiveMetadata->Name = $data->name;
-        $organisationObject->OrganizationDescriptiveMetadata->LegalClassification = $data->legalClassification;
-
-        if ($data->address) {
-            $organisationObject->OrganizationDescriptiveMetadata->Address = $this->getAddress($data->address);
-        }
-
-        if ($data->communication) {
-            $organisationObject->OrganizationDescriptiveMetadata->Communication = $this->getCommunication($data->communication);
-        }
-
-        if ($data->contact) {
-            $organisationObject->OrganizationDescriptiveMetadata->Contact = $this->getContact($data->contact);
-        }
-
-        return $organisationObject;
-    }
-
-    private function getContact($data)
-    {
-        $listContact = [];
-        foreach ($data as $contact) {
-            $tmpContact =  new stdClass();
-            $tmpContact->DepartmentName = $contact->departmentName;
-            $tmpContact->PersonName = $contact->personName;
-
-            if ($contact->address){
-                $tmpContact->Address = [];
-                $tmpContact->Address = $this->getAddress($contact->address);
-            }
-
-            if ($contact->communication) {
-                $tmpContact->Communication = [];
-                $tmpContact->Communication = $this->getCommunication($contact->communication);
-            }
-            $listContact[] = $tmpContact;
-        }
-        return $listContact;
-    }
-
-    private function getAddress($data)
-    {
-        $listAddress = [];
-        foreach ($data as $address) {
-            $tmpAddress = new stdClass();
-            $tmpAddress->CityName = $address->cityName;
-            $tmpAddress->Country = $address->country;
-            $tmpAddress->PostCode = $address->postCode;
-            $tmpAddress->StreetName = $address->streetName;
-
-            $listAddress[] = $tmpAddress;
-        }
-        return $listAddress;
-    }
-
-    private function getCommunication($data)
-    {
-        $listCommunication = [];
-        foreach ($data as $communication) {
-            $tmpCommunication = new stdClass();
-            $tmpCommunication->Channel = $communication->channel;
-
-            if ($communication->completeNumber) {
-                $tmpCommunication->value = $communication->completeNumber;
-            } else {
-                $tmpCommunication->value = $communication->URIID;
-            }
-            $listCommunication[] = $tmpCommunication;
-        }
-        return $listCommunication;
-    }
-}
diff --git a/src/app/external/exportSeda/models/ExportSedaModel.php b/src/app/external/exportSeda/models/ExportSedaModel.php
deleted file mode 100755
index 6636237406d..00000000000
--- a/src/app/external/exportSeda/models/ExportSedaModel.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
-* Copyright Maarch since 2008 under licence GPLv3.
-* See LICENCE.txt file at the root folder for more details.
-* This file is part of Maarch software.
-*
-*/
-
-/**
-* @brief Export Seda Model
-* @author dev@maarch.org
-*/
-
-namespace ExportSeda\models;
-
-class ExportSedaModel extends ExportSedaModelAbstract
-{
-}
diff --git a/src/app/external/exportSeda/models/ExportSedaModelAbstract.php b/src/app/external/exportSeda/models/ExportSedaModelAbstract.php
deleted file mode 100755
index 134500f0617..00000000000
--- a/src/app/external/exportSeda/models/ExportSedaModelAbstract.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * Copyright Maarch since 2008 under licence GPLv3.
- * See LICENCE.txt file at the root folder for more details.
- * This file is part of Maarch software.
- *
- */
-
-/**
- * @brief Export Seda Model
- * @author dev@maarch.org
- */
-
-namespace ExportSeda\models;
-
-abstract class ExportSedaModelAbstract
-{
-}
diff --git a/src/app/external/exportSeda/resources/AbstractRule.xml b/src/app/external/exportSeda/resources/AbstractRule.xml
new file mode 100644
index 00000000000..228090918d1
--- /dev/null
+++ b/src/app/external/exportSeda/resources/AbstractRule.xml
@@ -0,0 +1,4 @@
+<?merge $abstractRule.Rule.bool() ?><Rule><?merge $abstractRule.Rule.value ?></Rule>
+<?merge $abstractRule.StartDate.bool() ?><StartDate><?merge $abstractRule.StartDate.value ?></StartDate>
+<PreventInheritance><?merge $abstractRule.PreventInheritance ?></PreventInheritance>
+<RefNonRuleId><?merge $abstractRule.RefNonRuleId ?></RefNonRuleId>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/Acknowledgement.xml b/src/app/external/exportSeda/resources/Acknowledgement.xml
new file mode 100644
index 00000000000..977b6f0e086
--- /dev/null
+++ b/src/app/external/exportSeda/resources/Acknowledgement.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Acknowledgement xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0">
+	<?merge Acknowledgement.Comment ?><Comment><?merge .value ?></Comment>
+	<Date><?merge Acknowledgement.Date ?></Date>
+	<?merge Acknowledgement.MessageIdentifier $messageIdentifier ?><?xinclude /resources/MessageIdentifier.xml ?>
+	<?merge Acknowledgement.Signature.bool() ?>
+	<Signature><?merge Acknowledgement.Signature ?></Signature>
+	<?merge Acknowledgement.MessageReceivedIdentifier $messageReceivedIdentifier ?><?xinclude /resources/MessageReceivedIdentifier.xml ?>
+	<Sender>
+		<?merge Acknowledgement.Sender $organization ?>
+		<?xinclude /resources/Organization.xml ?>
+	</Sender>
+	<Receiver>
+		<?merge Acknowledgement.Receiver $organization ?>
+		<?xinclude /resources/Organization.xml ?>
+	</Receiver>
+</Acknowledgement>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/Agent.xml b/src/app/external/exportSeda/resources/Agent.xml
new file mode 100644
index 00000000000..f7907a56bcd
--- /dev/null
+++ b/src/app/external/exportSeda/resources/Agent.xml
@@ -0,0 +1,15 @@
+<?merge $agent.FirstName.bool() ?><FirstName><?merge $agent.FirstName ?></FirstName>
+<?merge $agent.BirthName.bool() ?><BirthName><?merge $agent.BirthName ?></BirthName>
+<?merge $agent.GivenName.bool() ?><GivenName><?merge $agent.GivenName ?></GivenName>
+<?merge $agent.Gender.bool() ?><Gender><?merge $agent.Gender ?></Gender>
+<?merge $agent.BirthDate.bool() ?><BirthDate><?merge $agent.BirthDate ?></BirthDate>
+<?merge $agent.BirthPlace.bool() ?><BirthPlace><?merge $agent.BirthPlace ?></BirthPlace>
+<?merge $agent.DeathDate.bool() ?><DeathDate><?merge $agent.DeathDate ?></DeathDate>
+<?merge $agent.DeathPlace.bool() ?><DeathPlace><?merge $agent.DeathPlace ?></DeathPlace>
+<?merge $agent.Nationality.bool() ?><Nationality><?merge $agent.Nationality ?></Nationality>
+<?merge $agent.Function.bool() ?><Function><?merge $agent.Function ?></Function>
+<?merge $agent.Activity.bool() ?><Activity><?merge $agent.Activity ?></Activity>
+<?merge $agent.Position.bool() ?><Position><?merge $agent.Position ?></Position>
+<?merge $agent.Role.bool() ?><Role><?merge $agent.Role ?></Role>
+<?merge $agent.Corpname.bool() ?><Corpname><?merge $agent.Corpname ?></Corpname>
+<?merge $agent.Identifier.bool() ?><Identifier><?merge $agent.Identifier ?></Identifier>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/ArchivalAgreement.xml b/src/app/external/exportSeda/resources/ArchivalAgreement.xml
new file mode 100644
index 00000000000..43a39c64562
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchivalAgreement.xml
@@ -0,0 +1 @@
+<ArchivalAgreement schemeID="[?merge $archivalAgreement.schemeID ?]" schemeName="[?merge $archivalAgreement.schemeName ?]" schemeAgencyID="[?merge $archivalAgreement.schemeAgencyID ?]" schemeAgencyName="[?merge $archivalAgreement.schemeAgencyName ?]" schemeVersionID="[?merge $archivalAgreement.schemeVersionID ?]" schemeDataURI="[?merge $archivalAgreement.schemeDataURI ?]" schemeURI="[?merge $archivalAgreement.schemeURI ?]"><?merge $archivalAgreement.value ?></ArchivalAgreement>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/ArchiveModificationNotification.xml b/src/app/external/exportSeda/resources/ArchiveModificationNotification.xml
new file mode 100644
index 00000000000..dbe515b16c7
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchiveModificationNotification.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ArchiveModificationNotification xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0">
+    <?merge ArchiveModificationNotification.Comment ?><Comment><?merge .value ?></Comment>
+    <Date><?merge ArchiveModificationNotification.Date ?></Date>
+    <?merge ArchiveModificationNotification.MessageIdentifier $messageIdentifier ?><?xinclude /resources/MessageIdentifier.xml ?>
+    <?xinclude /resources/CodeListVersions.xml ?>
+    <UnitIdentifier><?merge ArchiveModificationNotification.UnitIdentifier.value ?></UnitIdentifier>
+    <ArchivalAgency>
+        <?merge ArchiveModificationNotification.ArchivalAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </ArchivalAgency>
+    <OriginatingAgency>
+        <?merge ArchiveModificationNotification.OriginatingAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </OriginatingAgency>
+</ArchiveModificationNotification>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/ArchiveTransfer.xml b/src/app/external/exportSeda/resources/ArchiveTransfer.xml
new file mode 100644
index 00000000000..d6469dc141e
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchiveTransfer.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ArchiveTransfer xmlns="fr:gouv:culture:archivesdefrance:seda:v2.1">
+    <?merge ArchiveTransfer.Comment ?><Comment><?merge .value ?></Comment>
+    <Date><?merge ArchiveTransfer.Date ?></Date>
+    <?merge ArchiveTransfer.MessageIdentifier $messageIdentifier ?><?xinclude /resources/MessageIdentifier.xml ?>
+    <?merge ArchiveTransfer.ArchivalAgreement $archivalAgreement ?><?xinclude /resources/ArchivalAgreement.xml ?>
+    <?xinclude /resources/CodeListVersions.xml ?>
+    <?merge ArchiveTransfer.DataObjectPackage $dataObjectPackage ?>
+    <?xinclude /resources/DataObjectPackage.xml ?>
+    <ArchivalAgency>
+        <?merge ArchiveTransfer.ArchivalAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </ArchivalAgency>
+    <TransferringAgency>
+        <?merge ArchiveTransfer.TransferringAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </TransferringAgency>
+</ArchiveTransfer>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/ArchiveTransferReply.xml b/src/app/external/exportSeda/resources/ArchiveTransferReply.xml
new file mode 100644
index 00000000000..d803a3418b9
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchiveTransferReply.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ArchiveTransferReply xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0">
+    <?merge ArchiveTransferReply.Comment ?><Comment><?merge .value ?></Comment>
+    <Date><?merge ArchiveTransferReply.Date ?></Date>
+    <?merge ArchiveTransferReply.MessageIdentifier $messageIdentifier ?><?xinclude /resources/MessageIdentifier.xml ?>
+    <?merge ArchiveTransferReply.MessageRequestIdentifier $messageRequestIdentifier ?><?xinclude /resources/MessageRequestIdentifier.xml ?>
+    <?merge ArchiveTransferReply.ArchivalAgreement $archivalAgreement ?><?xinclude /resources/ArchivalAgreement.xml ?>
+    <ReplyCode><?merge ArchiveTransferReply.ReplyCode ?></ReplyCode>
+    <?xinclude /resources/CodeListVersions.xml ?>
+    <?merge ArchiveTransferReply.DataObjectPackage $dataObjectPackage ?>
+    <?merge ArchiveTransferReply.DataObjectPackage.bool() ?>
+    <?xinclude /resources/DataObjectPackage.xml ?>
+    <GrantDate><?merge ArchiveTransferReplyCode.GrantDate ?></GrantDate>
+    <ArchivalAgency>
+        <?merge ArchiveTransferReply.ArchivalAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </ArchivalAgency>
+    <TransferringAgency>
+        <?merge ArchiveTransferReply.TransferringAgency $organization ?>
+        <?xinclude /resources/Organization.xml ?>
+    </TransferringAgency>
+</ArchiveTransferReply>
diff --git a/src/app/external/exportSeda/resources/ArchiveUnit.xml b/src/app/external/exportSeda/resources/ArchiveUnit.xml
new file mode 100644
index 00000000000..16779c8aaf9
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchiveUnit.xml
@@ -0,0 +1,224 @@
+<?merge $archiveUnit ?>
+<ArchiveUnit id="[?merge .id ?]">
+    <ArchiveUnitRefId><?merge .ArchiveUnitRefId ?></ArchiveUnitRefId>
+    <ArchiveUnitProfile schemeID="[?merge .ArchiveUnitProfile.schemeID ?]" schemeName="[?merge .ArchiveUnitProfile.schemeName ?]" schemeAgencyID="[?merge .ArchiveUnitProfile.schemeAgencyID ?]" schemeAgencyName="[?merge .ArchiveUnitProfile.schemeAgencyName ?]" schemeVersionID="[?merge .ArchiveUnitProfile.schemeVersionID ?]" schemeDataURI="[?merge .ArchiveUnitProfile.schemeDataURI ?]" schemeURI="[?merge .ArchiveUnitProfile.schemeURI ?]"><?merge .ArchiveUnitProfile ?></ArchiveUnitProfile>
+    <?merge .Management.bool() ?>
+    <Management>
+        <?merge .Management.ArchivalProfile.bool() ?><ArchivalProfile><?merge .Management.ArchivalProfile.value ?></ArchivalProfile>
+        <?merge .Management.ServiceLevel.bool() ?><ServiceLevel><?merge .Management.ServiceLevel.value ?></ServiceLevel>
+        <?merge .Management.StorageRule.bool() ?>
+        <StorageRule>
+            <?merge .Management.StorageRule.Rule.bool() ?><Rule><?merge .Management.StorageRule.Rule.value ?></Rule>
+            <?merge .Management.StorageRule.StartDate.bool() ?><StartDate><?merge .Management.StorageRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.StorageRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.StorageRule.RefNonRuleId ?></RefNonRuleId>
+            <FinalAction><?merge .Management.StorageRule.FinalAction ?></FinalAction>
+        </StorageRule>
+        <?merge .Management.AppraisalRule.bool() ?>
+        <AppraisalRule>
+            <?merge .Management.AppraisalRule.Rule.bool() ?><Rule><?merge .Management.AppraisalRule.Rule.value ?></Rule>
+            <?merge .Management.AppraisalRule.StartDate.bool() ?><StartDate><?merge .Management.AppraisalRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.AppraisalRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.AppraisalRule.RefNonRuleId ?></RefNonRuleId>
+            <FinalAction><?merge .Management.AppraisalRule.FinalAction ?></FinalAction>
+        </AppraisalRule>
+        <?merge .Management.AccessRule.bool() ?>
+        <AccessRule>
+            <?merge .Management.AccessRule.Rule.bool() ?><Rule><?merge .Management.AccessRule.Rule.value ?></Rule>
+            <?merge .Management.AccessRule.StartDate.bool() ?><StartDate><?merge .Management.AccessRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.AccessRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.AccessRule.RefNonRuleId ?></RefNonRuleId>
+        </AccessRule>
+        <?merge .Management.DisseminationRule.bool() ?>
+        <DisseminationRule>
+            <?merge .Management.DisseminationRule.Rule.bool() ?><Rule><?merge .Management.DisseminationRule.Rule.value ?></Rule>
+            <?merge .Management.DisseminationRule.StartDate.bool() ?><StartDate><?merge .Management.DisseminationRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.DisseminationRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.DisseminationRule.RefNonRuleId ?></RefNonRuleId>
+        </DisseminationRule>
+        <?merge .Management.ReuseRule.bool() ?>
+        <ReuseRule>
+            <?merge .Management.ReuseRule.Rule.bool() ?><Rule><?merge .Management.ReuseRule.Rule.value ?></Rule>
+            <?merge .Management.ReuseRule.StartDate.bool() ?><StartDate><?merge .Management.ReuseRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.ReuseRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.ReuseRule.RefNonRuleId ?></RefNonRuleId>
+        </ReuseRule>
+        <?merge .Management.ClassificationRule.bool() ?>
+        <ClassificationRule>
+            <?merge .Management.ClassificationRule.Rule.bool() ?><Rule><?merge .Management.ClassificationRule.Rule.value ?></Rule>
+            <?merge .Management.ClassificationRule.StartDate.bool() ?><StartDate><?merge .Management.ClassificationRule.StartDate ?></StartDate>
+            <PreventInheritance><?merge .Management.ClassificationRule.PreventInheritance ?></PreventInheritance>
+            <RefNonRuleId><?merge .Management.ClassificationRule.RefNonRuleId ?></RefNonRuleId>
+            <ClassificationLevel><?merge .Management.ClassificationRule.ClassificationLevel ?></ClassificationLevel>
+            <ClassificationOwner><?merge .Management.ClassificationRule.ClassificationOwner ?></ClassificationOwner>
+            <ClassificationReassessingDate><?merge .Management.ClassificationRule.ClassificationReassessingDate ?></ClassificationReassessingDate>
+            <NeedReassessingAuthorization><?merge .Management.ClassificationRule.NeedReassessingAuthorization ?></NeedReassessingAuthorization>
+        </ClassificationRule>
+        <?merge .Management.NeedAuthorization.bool() ?>
+        <NeedAuthorization>
+            <?merge .Management.NeedAuthorization ?>
+        </NeedAuthorization>
+        <?merge .Management.OtherManagementAbstract.bool() ?>
+        <OtherManagementAbstract>
+            <?merge .Management.OtherManagementAbstract ?>
+        </OtherManagementAbstract>
+    </Management>
+    <?merge .Content.bool() ?>
+    <Content>
+        <DescriptionLevel><?merge .Content.DescriptionLevel ?></DescriptionLevel>
+        <?merge .Content.Title ?><Title><?merge . ?></Title>
+        <?merge .Content.FilePlanPosition ?><FilePlanPosition schemeID="[?merge .schemeID @schemeID ?]" schemeName="[?merge .schemeName @schemeName ?]" schemeAgencyID="[?merge .schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge .schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge .schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge .schemeDataURI @schemeDataURI ?]" schemeURI="[?merge .schemeURI @schemeURI ?]"><?merge .value ?></FilePlanPosition>
+        <?merge .Content.OriginatingSystemId.bool() ?><OriginatingSystemId><?merge .Content.OriginatingSystemId ?></OriginatingSystemId>
+        <OriginatingAgencyArchiveUnitIdentifier><?merge .Content.OriginatingAgencyArchiveUnitIdentifier ?></OriginatingAgencyArchiveUnitIdentifier>
+        <?merge .Content.Description.bool() ?><Description><?merge .Content.Description ?></Description>
+        <?merge .Content.CustodialHistory.bool() ?>
+        <CustodialHistory>
+            <?merge .Content.CustodialHistory.CustodialHistoryItem ?>
+            <CustodialHistoryItem when="[?merge .when ?]"><?merge .value ?></CustodialHistoryItem>
+        </CustodialHistory>
+        <Type><?merge .Content.Type ?></Type>
+        <DocumentType><?merge .Content.DocumentType ?></DocumentType>
+        <Language><?merge .Content.Language ?></Language>
+        <DescriptionLanguage><?merge .Content.DescriptionLanguage ?></DescriptionLanguage>
+        <Status><?merge .Content.Status ?></Status>
+        <Version><?merge .Content.Version ?></Version>
+        <?merge .Content.Tag ?><Tag><?merge .value ?></Tag>
+        <?merge .Content.Keyword.array() ?><Keyword>
+            <KeywordContent role="[?merge .KeywordContent.role @role ?]"><?merge .KeywordContent.value ?></KeywordContent>
+            <KeywordReference schemeID="[?merge .KeywordReference.schemeID @schemeID ?]" schemeName="[?merge .KeywordReference.schemeName @schemeName ?]" schemeAgencyID="[?merge .KeywordReference.schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge .KeywordReference.schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge .KeywordReference.schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge .KeywordReference.schemeDataURI @schemeDataURI ?]" schemeURI="[?merge .KeywordReference.schemeURI @schemeURI ?]"><?merge .KeywordReference.value ?></KeywordReference>
+            <KeywordType listVersionID="[?merge .KeywordType.listVersionID @listVersionID ?]"><?merge .KeywordType ?></KeywordType>
+        </Keyword>
+        <?merge .Content.OriginatingAgency.bool() ?>
+        <OriginatingAgency>
+            <Identifier><?merge .Content.OriginatingAgency.Identifier.value ?></Identifier>
+        </OriginatingAgency>
+        <?merge .Content.SubmissionAgency.bool() ?>
+        <SubmissionAgency>
+            <?merge .Content.SubmissionAgency $organization ?>
+            <?xinclude /resources/Organization.xml ?>
+        </SubmissionAgency>
+        <?merge .Content.AuthorizedAgend.bool() ?>
+        <AuthorizedAgent>
+            <FirstName><?merge .Content.AuthorizedAgend.FirstName ?></FirstName>
+            <BirthName><?merge .Content.AuthorizedAgend.BirthName ?></BirthName>
+            <GivenName><?merge .Content.AuthorizedAgend.GivenName ?></GivenName>
+            <Gender><?merge .Content.AuthorizedAgend.Gender ?></Gender>
+            <BirthDate><?merge .Content.AuthorizedAgend.BirthDate ?></BirthDate>
+            <BirthPlace><?merge .Content.AuthorizedAgend.BirthPlace ?></BirthPlace>
+            <DeathDate><?merge .Content.AuthorizedAgend.DeathDate ?></DeathDate>
+            <DeathPlace><?merge .Content.AuthorizedAgend.DeathPlace ?></DeathPlace>
+            <Nationality><?merge .Content.AuthorizedAgend.Nationality ?></Nationality>
+            <Function><?merge .Content.AuthorizedAgend.Function ?></Function>
+            <Activity><?merge .Content.AuthorizedAgend.Activity ?></Activity>
+            <Position><?merge .Content.AuthorizedAgend.Position ?></Position>
+            <Role><?merge .Content.AuthorizedAgend.Role ?></Role>
+            <Corpname><?merge .Content.AuthorizedAgend.Corpname ?></Corpname>
+            <Identifier><?merge .Content.AuthorizedAgend.Identifier ?></Identifier>
+        </AuthorizedAgent>
+        <?merge .Content.Writer.array() ?>
+        <Writer>
+            <FirstName><?merge .FirstName ?></FirstName>
+            <BirthName><?merge .BirthName ?></BirthName>
+            <GivenName><?merge .GivenName ?></GivenName>
+            <Gender><?merge .Gender ?></Gender>
+            <BirthDate><?merge .BirthDate ?></BirthDate>
+            <BirthPlace><?merge .BirthPlace ?></BirthPlace>
+            <DeathDate><?merge .DeathDate ?></DeathDate>
+            <DeathPlace><?merge .DeathPlace ?></DeathPlace>
+            <Nationality><?merge .Nationality ?></Nationality>
+            <Function><?merge .Function ?></Function>
+            <Activity><?merge .Activity ?></Activity>
+            <Position><?merge .Position ?></Position>
+            <Role><?merge .Role ?></Role>
+            <Corpname><?merge .Corpname ?></Corpname>
+            <Identifier><?merge .Identifier ?></Identifier>
+        </Writer>
+        <?merge .Content.Addressee.array()?>
+        <Addressee>
+            <FirstName><?merge .FirstName ?></FirstName>
+            <BirthName><?merge .BirthName ?></BirthName>
+            <GivenName><?merge .GivenName ?></GivenName>
+            <Gender><?merge .Gender ?></Gender>
+            <BirthDate><?merge .BirthDate ?></BirthDate>
+            <BirthPlace><?merge .BirthPlace ?></BirthPlace>
+            <DeathDate><?merge .DeathDate ?></DeathDate>
+            <DeathPlace><?merge .DeathPlace ?></DeathPlace>
+            <Nationality><?merge .Nationality ?></Nationality>
+            <Function><?merge .Function ?></Function>
+            <Activity><?merge .Activity ?></Activity>
+            <Position><?merge .Position ?></Position>
+            <Role><?merge .Role ?></Role>
+            <Corpname><?merge .Corpname ?></Corpname>
+            <Identifier><?merge .Identifier ?></Identifier>
+        </Addressee>
+        <?merge .Content.Recipient.array() ?>
+        <Recipient>
+            <FirstName><?merge .FirstName ?></FirstName>
+            <BirthName><?merge .BirthName ?></BirthName>
+            <GivenName><?merge .GivenName ?></GivenName>
+            <Gender><?merge .Gender ?></Gender>
+            <BirthDate><?merge .BirthDate ?></BirthDate>
+            <BirthPlace><?merge .BirthPlace ?></BirthPlace>
+            <DeathDate><?merge .DeathDate ?></DeathDate>
+            <DeathPlace><?merge .DeathPlace ?></DeathPlace>
+            <Nationality><?merge .Nationality ?></Nationality>
+            <Function><?merge .Function ?></Function>
+            <Activity><?merge .Activity ?></Activity>
+            <Position><?merge .Position ?></Position>
+            <Role><?merge .Role ?></Role>
+            <Corpname><?merge .Corpname ?></Corpname>
+            <Identifier><?merge .Identifier ?></Identifier>
+        </Recipient>
+        <?merge .Content.Sender.array() ?>
+        <Sender>
+            <FirstName><?merge .FirstName ?></FirstName>
+            <BirthName><?merge .BirthName ?></BirthName>
+            <GivenName><?merge .GivenName ?></GivenName>
+            <Gender><?merge .Gender ?></Gender>
+            <BirthDate><?merge .BirthDate ?></BirthDate>
+            <BirthPlace><?merge .BirthPlace ?></BirthPlace>
+            <DeathDate><?merge .DeathDate ?></DeathDate>
+            <DeathPlace><?merge .DeathPlace ?></DeathPlace>
+            <Nationality><?merge .Nationality ?></Nationality>
+            <Function><?merge .Function ?></Function>
+            <Activity><?merge .Activity ?></Activity>
+            <Position><?merge .Position ?></Position>
+            <Role><?merge .Role ?></Role>
+            <Corpname><?merge .Corpname ?></Corpname>
+            <Identifier><?merge .Identifier ?></Identifier>
+        </Sender>
+        <Source><?merge .Content.Source ?></Source>
+        <?merge .Content.RelatedObjectReference.bool() ?>
+        <RelatedObjectReference>
+            <?merge .Content.RelatedObjectReference.References ?>
+            <References>
+                <ArchiveUnitRefId><?merge .ArchiveUnitRefId ?></ArchiveUnitRefId>
+                <RepositoryArchiveUnitPID><?merge .RepositoryArchiveUnitPID ?></RepositoryArchiveUnitPID>
+            </References>
+        </RelatedObjectReference>
+        <CreatedDate><?merge .Content.CreatedDate ?></CreatedDate>
+        <TransactedDate><?merge .Content.TransactedDate ?></TransactedDate>
+        <AcquiredDate><?merge .Content.AcquiredDate ?></AcquiredDate>
+        <SentDate><?merge .Content.SentDate ?></SentDate>
+        <ReceivedDate><?merge .Content.ReceivedDate ?></ReceivedDate>
+        <RegisteredDate><?merge .Content.RegisteredDate ?></RegisteredDate>
+        <StartDate><?merge .Content.StartDate ?></StartDate>
+        <EndDate><?merge .Content.EndDate ?></EndDate>
+        <?merge .Content.Event.array() ?>
+        <Event>
+            <EventIdentifier><?merge .EventIdentifier ?></EventIdentifier>
+            <EventType><?merge .EventType ?></EventType>
+            <EventDateTime><?merge .EventDateTime ?></EventDateTime>
+            <EventDetail><?merge .EventDetail ?></EventDetail>
+        </Event>
+    </Content>
+    <?merge .ArchiveUnit.array() ?>
+    <?xinclude /resources/ArchiveUnit.xml ?>
+    <?merge .DataObjectReference.array() ?>
+    <DataObjectReference>
+        <?merge .DataObjectReferenceId.bool() ?>
+        <DataObjectReferenceId><?merge .DataObjectReferenceId ?></DataObjectReferenceId>
+        <?merge .DataObjectGroupReferenceId.bool() ?>
+        <DataObjectGroupReferenceId><?merge .DataObjectGroupReferenceId ?></DataObjectGroupReferenceId>
+    </DataObjectReference>
+</ArchiveUnit>
diff --git a/src/app/external/exportSeda/resources/ArchiveUnitChildren.xml b/src/app/external/exportSeda/resources/ArchiveUnitChildren.xml
new file mode 100644
index 00000000000..ad90dcf2a30
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ArchiveUnitChildren.xml
@@ -0,0 +1,131 @@
+<ArchiveUnit id="arch_child_[?merge .id ?]">
+    <ArchiveUnitRefId><?merge .ArchiveUnitRefId ?></ArchiveUnitRefId>
+    <ArchiveUnitProfile schemeID="[?merge .ArchiveUnitProfile.schemeID ?]" schemeName="[?merge .ArchiveUnitProfile.schemeName ?]" schemeAgencyID="[?merge .ArchiveUnitProfile.schemeAgencyID ?]" schemeAgencyName="[?merge .ArchiveUnitProfile.schemeAgencyName ?]" schemeVersionID="[?merge .ArchiveUnitProfile.schemeVersionID ?]" schemeDataURI="[?merge .ArchiveUnitProfile.schemeDataURI ?]" schemeURI="[?merge .ArchiveUnitProfile.schemeURI ?]"><?merge .ArchiveUnitProfile ?></ArchiveUnitProfile>
+    <?merge .Management.bool() ?>
+    <Management>
+        <?merge .Management.StorageRule.bool() ?>
+        <StorageRule>
+            <?merge .management.StorageRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+            <FinalAction><?merge .Management.StorageRule.FinalAction ?></FinalAction>
+        </StorageRule>
+        <?merge .Management.AppraisalRule.bool() ?>
+        <AppraisalRule>
+            <?merge .Management.AppraisalRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+            <FinalAction><?merge .Management.AppraisalRule.finalAction ?></FinalAction>
+        </AppraisalRule>
+        <?merge .Management.AccessRule.bool() ?>
+        <AccessRule>
+            <?merge .Management.AccessRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+        </AccessRule>
+        <?merge .Management.DisseminationRule.bool() ?>
+        <DisseminationRule>
+            <?merge .Management.DisseminationRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+        </DisseminationRule>
+        <?merge .Management.ReuseRule.bool() ?>
+        <ReuseRule>
+            <?merge .Management.ReuseRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+        </ReuseRule>
+        <?merge .Management.ClassificationRule.bool() ?>
+        <ClassificationRule>
+            <?merge .Management.ClassificationRule $abstractRule ?>
+            <?xinclude /resources/AbstractRule.xml ?>
+            <ClassificationLevel><?merge .Management.ClassificationRule.ClassificationLevel ?></ClassificationLevel>
+            <ClassificationOwner><?merge .Management.ClassificationRule.ClassificationOwner ?></ClassificationOwner>
+            <ClassificationReassessingDate><?merge .Management.ClassificationRule.ClassificationReassessingDate ?></ClassificationReassessingDate>
+            <NeedReassessingAuthorization><?merge .Management.ClassificationRule.NeedReassessingAuthorization ?></NeedReassessingAuthorization>
+        </ClassificationRule>
+        <?merge .Management.NeedAuthorization.bool() ?>
+        <NeedAuthorization>
+            <?merge .Management.NeedAuthorization ?>
+        </NeedAuthorization>
+        <?merge .Management.OtherManagementAbstract.bool() ?>
+        <OtherManagementAbstract>
+            <?merge .Management.OtherManagementAbstract ?>
+        </OtherManagementAbstract>
+    </Management>
+    <?merge .Content.bool() ?>
+    <Content>
+        <DescriptionLevel><?merge .Content.DescriptionLevel ?></DescriptionLevel>
+        <?merge .Content.Title ?><Title><?merge . ?></Title>
+        <?merge .Content.FilePlanPosition ?><FilePlanPosition schemeID="[?merge .schemeID @schemeID ?]" schemeName="[?merge .schemeName @schemeName ?]" schemeAgencyID="[?merge .schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge .schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge .schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge .schemeDataURI @schemeDataURI ?]" schemeURI="[?merge .schemeURI @schemeURI ?]"><?merge .value ?></FilePlanPosition>
+        <?merge .Content.OriginatingSystemId ?><OriginatingSystemId><?merge .Content.OriginatingSystemId ?></OriginatingSystemId>
+        <OriginatingAgencyArchiveUnitIdentifier><?merge .Content.OriginatingAgencyArchiveUnitIdentifier ?></OriginatingAgencyArchiveUnitIdentifier>
+        <?merge .Content.Description.bool() ?><Description><?merge .Content.Description ?></Description>
+        <?merge .Content.CustodialHistory.bool() ?>
+        <CustodialHistory>
+            <?merge .Content.CustodialHistory.CustodialHistoryItem ?>
+            <CustodialHistoryItem when="[?merge .when ?]"><?merge .value ?></CustodialHistoryItem>
+        </CustodialHistory>
+        <Type><?merge .Content.Type ?></Type>
+        <DocumentType><?merge .Content.DocumentType ?></DocumentType>
+        <Language><?merge .Content.Language ?></Language>
+        <DescriptionLanguage><?merge .Content.DescriptionLanguage ?></DescriptionLanguage>
+        <Status><?merge .Content.Status ?></Status>
+        <Version><?merge .Content.Version ?></Version>
+        <?merge .Content.Tag ?><Tag><?merge .value ?></Tag>
+        <?merge .Content.Keyword.array() ?>
+        <Keyword>
+            <KeywordContent role="[?merge .KeywordContent.role @role ?]"><?merge .KeywordContent.value ?></KeywordContent>
+            <KeywordReference schemeID="[?merge .KeywordReference.schemeID @schemeID ?]" schemeName="[?merge .KeywordReference.schemeName @schemeName ?]" schemeAgencyID="[?merge .KeywordReference.schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge .KeywordReference.schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge .KeywordReference.schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge .KeywordReference.schemeDataURI @schemeDataURI ?]" schemeURI="[?merge .KeywordReference.schemeURI @schemeURI ?]"><?merge .KeywordReference.value ?></KeywordReference>
+            <KeywordType listVersionID="[?merge .KeywordType.listVersionID @listVersionID ?]"><?merge .KeywordType ?></KeywordType>
+        </Keyword>
+        <?merge .Content.OriginatingAgency.bool() ?>
+        <OriginatingAgency>
+            <Identifier><?merge .Content.OriginatingAgency.Identifier.value ?></Identifier>
+        </OriginatingAgency>
+        <?merge .Content.SubmissionAgency.bool() ?>
+        <SubmissionAgency>
+            <?merge .Content.SubmissionAgency $organization ?>
+            <?xinclude /resources/Organization.xml ?>
+        </SubmissionAgency>
+        <?merge .Content.AuthorizedAgend.bool() ?>
+        <AuthorizedAgent>
+            <?merge .AuthorizedAgent $agent ?>
+            <?xinclude /resources/Agent.xml ?>
+        </AuthorizedAgent>
+        <?merge .Content.Writter.array() ?>
+        <Writter>
+            <?merge . $agent ?>
+            <?xinclude /resources/Agent.xml ?>
+        </Writter>
+        <?merge .Content.Addressee.array()?>
+        <Addressee>
+            <?merge . $agent ?>
+            <?xinclude /resources/Agent.xml ?>
+        </Addressee>
+        <?merge .Content.Recipient.array() ?>
+        <Recipient>
+            <?merge . $agent ?>
+            <?xinclude /resources/Agent.xml ?>
+        </Recipient>
+        <Source><?merge .Content.Source ?></Source>
+        <CreatedDate><?merge .Content.CreatedDate ?></CreatedDate>
+        <TransactedDate><?merge .Content.TransactedDate ?></TransactedDate>
+        <AcquiredDate><?merge .Content.AcquiredDate ?></AcquiredDate>
+        <SentDate><?merge .Content.SentDate ?></SentDate>
+        <ReceivedDate><?merge .Content.ReceivedDate ?></ReceivedDate>
+        <RegisteredDate><?merge .Content.RegisteredDate ?></RegisteredDate>
+        <StartDate><?merge .Content.StartDate ?></StartDate>
+        <EndDate><?merge .Content.EndDate ?></EndDate>
+        <?merge .Content.Event.array() ?>
+        <Event>
+            <EventIdentifier><?merge .EventIdentifier ?></EventIdentifier>
+            <EventType><?merge .EventType ?></EventType>
+            <EventDateTime><?merge .EventDateTime ?></EventDateTime>
+            <EventDetail><?merge .EventDetail ?></EventDetail>
+        </Event>
+    </Content>
+
+    <?merge .DataObjectReference.bool() ?>
+    <DataObjectReference>
+        <?merge .DataObjectReference.DataObjectReferenceId.bool() ?>
+        <DataObjectReferenceId><?merge .DataObjectReference.DataObjectReferenceId ?></DataObjectReferenceId>
+        <?merge .DataObjectReference.DataObjectGroupReferenceId.bool() ?>
+        <DataObjectGroupReferenceId><?merge .DataObjectReference.DataObjectGroupReferenceId ?></DataObjectGroupReferenceId>
+    </DataObjectReference>
+</ArchiveUnit>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/CodeListVersions.xml b/src/app/external/exportSeda/resources/CodeListVersions.xml
new file mode 100644
index 00000000000..86724d21c98
--- /dev/null
+++ b/src/app/external/exportSeda/resources/CodeListVersions.xml
@@ -0,0 +1,17 @@
+<CodeListVersions>
+  <ReplyCodeListVersion >""</ReplyCodeListVersion>
+  <MessageDigestAlgorithmCodeListVersion >""</MessageDigestAlgorithmCodeListVersion>
+  <MimeTypeCodeListVersion >""</MimeTypeCodeListVersion>
+  <EncodingCodeListVersion >""</EncodingCodeListVersion>
+  <FileFormatCodeListVersion >""</FileFormatCodeListVersion>
+  <CompressionAlgorithmCodeListVersion >""</CompressionAlgorithmCodeListVersion>
+  <DataObjectVersionCodeListVersion >""</DataObjectVersionCodeListVersion>
+  <StorageRuleCodeListVersion >""</StorageRuleCodeListVersion>
+  <AppraisalRuleCodeListVersion >""</AppraisalRuleCodeListVersion>
+  <AccessRuleCodeListVersion >""</AccessRuleCodeListVersion>
+  <DisseminationRuleCodeListVersion >""</DisseminationRuleCodeListVersion>
+  <ReuseRuleCodeListVersion >""</ReuseRuleCodeListVersion>
+  <ClassificationRuleCodeListVersion >""</ClassificationRuleCodeListVersion>
+  <AuthorizationReasonCodeListVersion >""</AuthorizationReasonCodeListVersion>
+  <RelationshipCodeListVersion >""</RelationshipCodeListVersion>
+</CodeListVersions>
diff --git a/src/app/external/exportSeda/resources/DataObjectPackage.xml b/src/app/external/exportSeda/resources/DataObjectPackage.xml
new file mode 100644
index 00000000000..5e0dc3a9049
--- /dev/null
+++ b/src/app/external/exportSeda/resources/DataObjectPackage.xml
@@ -0,0 +1,28 @@
+<DataObjectPackage>
+    <?merge $dataObjectPackage.BinaryDataObject ?>
+    <BinaryDataObject id="[?merge .id ?]">
+        <?merge .Attachment.bool() ?><Attachment filename="[?merge .Attachment.filename ?]" uri="[?merge .Attachment.uri ?]"><?merge .Attachment.value ?></Attachment>
+        <?merge .Uri.bool() ?><Uri><?merge .Uri ?></Uri>
+        <MessageDigest algorithm="[?merge .MessageDigest.algorithm ?]"><?merge .MessageDigest.value ?></MessageDigest>
+        <Size><?merge .Size ?></Size>
+        <FormatIdentification>
+            <MimeType><?merge .FormatIdentification.MimeType ?></MimeType>
+            <FormatId><?merge .FormatIdentification.FormatId ?></FormatId>
+        </FormatIdentification>
+        <?merge .FileInfo.bool() ?>
+        <FileInfo>
+            <Filename><?merge .FileInfo.Filename ?></Filename>
+        </FileInfo>
+    </BinaryDataObject>
+    <?merge $dataObjectPackage.PhysicalDataObject.bool() ?>
+    <PhysicalDataObject>
+        <?merge .bool() ?>
+        <PhysicalId schemeID="[?merge .PhysicalId.schemeID ?]" schemeName="[?merge .PhysicalId.schemeName ?]" schemeAgencyID="[?merge .PhysicalId.schemeAgencyID ?]" schemeAgencyName="[?merge .PhysicalId.schemeAgencyName ?]" schemeVersionID="[?merge .PhysicalId.schemeVersionID ?]" schemeDataURI="[?merge .PhysicalId.schemeDataURI ?]" schemeURI="[?merge .PhysicalId.schemeURI ?]"><?merge .PhysicalId.value ?></PhysicalId>
+    </PhysicalDataObject>
+    <DescriptiveMetadata>
+        <?merge $dataObjectPackage.DescriptiveMetadata.ArchiveUnit ?>
+        <?xinclude /resources/ArchiveUnit.xml ?>
+    </DescriptiveMetadata>
+    <?merge $dataObjectPackage.ManagementMetadata $managementMetadata ?>
+    <?xinclude /resources/ManagementMetadata.xml ?>
+</DataObjectPackage>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/ManagementMetadata.xml b/src/app/external/exportSeda/resources/ManagementMetadata.xml
new file mode 100644
index 00000000000..66229a9ab12
--- /dev/null
+++ b/src/app/external/exportSeda/resources/ManagementMetadata.xml
@@ -0,0 +1,60 @@
+<ManagementMetadata>
+    <?merge $managementMetadata.ArchivalProfile.bool() ?><ArchivalProfile><?merge $managementMetadata.ArchivalProfile.value ?></ArchivalProfile>
+    <?merge $managementMetadata.ServiceLevel.bool() ?><ServiceLevel><?merge $managementMetadata.ServiceLevel.value ?></ServiceLevel>
+    <?merge $managementMetadata.StorageRule.bool() ?>
+    <StorageRule>
+        <?merge $managementMetadata.StorageRule.Rule.bool() ?><Rule><?merge $managementMetadata.StorageRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.StorageRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.StorageRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.StorageRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.StorageRule.RefNonRuleId ?></RefNonRuleId>
+        <FinalAction><?merge $managementMetadata.StorageRule.FinalAction ?></FinalAction>
+    </StorageRule>
+    <?merge $managementMetadata.AppraisalRule.bool() ?>
+    <AppraisalRule>
+        <?merge $managementMetadata.AppraisalRule.Rule.bool() ?><Rule><?merge $managementMetadata.AppraisalRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.AppraisalRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.AppraisalRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.AppraisalRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.AppraisalRule.RefNonRuleId ?></RefNonRuleId>
+        <FinalAction><?merge $managementMetadata.AppraisalRule.FinalAction ?></FinalAction>
+    </AppraisalRule>
+    <?merge $managementMetadata.AccessRule.bool() ?>
+    <AccessRule>
+        <?merge $managementMetadata.AccessRule.Rule.bool() ?><Rule><?merge $managementMetadata.AccessRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.AccessRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.AccessRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.AccessRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.AccessRule.RefNonRuleId ?></RefNonRuleId>
+    </AccessRule>
+    <?merge $managementMetadata.DisseminationRule.bool() ?>
+    <DisseminationRule>
+        <?merge $managementMetadata.DisseminationRule.Rule.bool() ?><Rule><?merge $managementMetadata.DisseminationRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.DisseminationRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.DisseminationRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.DisseminationRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.DisseminationRule.RefNonRuleId ?></RefNonRuleId>
+    </DisseminationRule>
+    <?merge $managementMetadata.ReuseRule.bool() ?>
+    <ReuseRule>
+        <?merge $managementMetadata.ReuseRule.Rule.bool() ?><Rule><?merge $managementMetadata.ReuseRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.ReuseRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.ReuseRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.ReuseRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.ReuseRule.RefNonRuleId ?></RefNonRuleId>
+    </ReuseRule>
+    <?merge $managementMetadata.ClassificationRule.bool() ?>
+    <ClassificationRule>
+        <?merge $managementMetadata.ClassificationRule.Rule.bool() ?><Rule><?merge $managementMetadata.ClassificationRule.Rule.value ?></Rule>
+        <?merge $managementMetadata.ClassificationRule.StartDate.bool() ?><StartDate><?merge $managementMetadata.ClassificationRule.StartDate.value ?></StartDate>
+        <PreventInheritance><?merge $managementMetadata.ClassificationRule.PreventInheritance ?></PreventInheritance>
+        <RefNonRuleId><?merge $managementMetadata.ClassificationRule.RefNonRuleId ?></RefNonRuleId>
+        <ClassificationLevel><?merge $managementMetadata.ClassificationRule.ClassificationLevel ?></ClassificationLevel>
+        <ClassificationOwner><?merge $managementMetadata.ClassificationRule.ClassificationOwner ?></ClassificationOwner>
+        <ClassificationReassessingDate><?merge $managementMetadata.ClassificationRule.ClassificationReassessingDate ?></ClassificationReassessingDate>
+        <NeedReassessingAuthorization><?merge $managementMetadata.ClassificationRule.NeedReassessingAuthorization ?></NeedReassessingAuthorization>
+    </ClassificationRule>
+    <?merge $managementMetadata.NeedAuthorization.bool() ?>
+    <NeedAuthorization>
+        <?merge $managementMetadata.NeedAuthorization ?>
+    </NeedAuthorization>
+    <?merge $managementMetadata.OtherManagementAbstract.bool() ?>
+    <OtherManagementAbstract>
+        <?merge $managementMetadata.OtherManagementAbstract ?>
+    </OtherManagementAbstract>
+</ManagementMetadata>
diff --git a/src/app/external/exportSeda/resources/MessageIdentifier.xml b/src/app/external/exportSeda/resources/MessageIdentifier.xml
new file mode 100644
index 00000000000..5dbb244cd71
--- /dev/null
+++ b/src/app/external/exportSeda/resources/MessageIdentifier.xml
@@ -0,0 +1 @@
+<MessageIdentifier schemeID="[?merge $messageIdentifier.schemeID ?]" schemeName="[?merge $messageIdentifier.schemeName ?]" schemeAgencyID="[?merge $messageIdentifier.schemeAgencyID ?]" schemeAgencyName="[?merge $messageIdentifier.schemeAgencyName ?]" schemeVersionID="[?merge $messageIdentifier.schemeVersionID ?]" schemeDataURI="[?merge $messageIdentifier.schemeDataURI ?]" schemeURI="[?merge $messageIdentifier.schemeURI ?]"><?merge $messageIdentifier.value ?></MessageIdentifier>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/MessageReceivedIdentifier.xml b/src/app/external/exportSeda/resources/MessageReceivedIdentifier.xml
new file mode 100644
index 00000000000..6bcd026274a
--- /dev/null
+++ b/src/app/external/exportSeda/resources/MessageReceivedIdentifier.xml
@@ -0,0 +1 @@
+<MessageReceivedIdentifier schemeID="[?merge $messageReceivedIdentifier.schemeID ?]" schemeName="[?merge $messageReceivedIdentifier.schemeName ?]" schemeAgencyID="[?merge $messageReceivedIdentifier.schemeAgencyID ?]" schemeAgencyName="[?merge $messageReceivedIdentifier.schemeAgencyName ?]" schemeVersionID="[?merge $messageReceivedIdentifier.schemeVersionID ?]" schemeDataURI="[?merge $messageReceivedIdentifier.schemeDataURI ?]" schemeURI="[?merge $messageReceivedIdentifier.schemeURI ?]"><?merge $messageReceivedIdentifier.value ?></MessageReceivedIdentifier>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/MessageRequestIdentifier.xml b/src/app/external/exportSeda/resources/MessageRequestIdentifier.xml
new file mode 100644
index 00000000000..d48ebd81890
--- /dev/null
+++ b/src/app/external/exportSeda/resources/MessageRequestIdentifier.xml
@@ -0,0 +1 @@
+<MessageRequestIdentifier schemeID="[?merge $messageRequestIdentifier.schemeID ?]" schemeName="[?merge $messageRequestIdentifier.schemeName ?]" schemeAgencyID="[?merge $messageRequestIdentifier.schemeAgencyID ?]" schemeAgencyName="[?merge $messageRequestIdentifier.schemeAgencyName ?]" schemeVersionID="[?merge $messageRequestIdentifier.schemeVersionID ?]" schemeDataURI="[?merge $messageRequestIdentifier.schemeDataURI ?]" schemeURI="[?merge $messageRequestIdentifier.schemeURI ?]"><?merge $messageRequestIdentifier.value ?></MessageRequestIdentifier>
\ No newline at end of file
diff --git a/src/app/external/exportSeda/resources/Organization.xml b/src/app/external/exportSeda/resources/Organization.xml
new file mode 100644
index 00000000000..f7c20b479b6
--- /dev/null
+++ b/src/app/external/exportSeda/resources/Organization.xml
@@ -0,0 +1,41 @@
+<Identifier schemeID="[?merge $organization.Identifier.schemeID @schemeID ?]" schemeName="[?merge $organization.Identifier.schemeName @schemeName ?]" schemeAgencyID="[?merge $organization.Identifier.schemeAgencyID @schemeAgencyID ?]" schemeAgencyName="[?merge $organization.Identifier.schemeAgencyName @schemeAgencyName ?]" schemeVersionID="[?merge $organization.Identifier.schemeVersionID @schemeVersionID ?]" schemeDataURI="[?merge $organization.Identifier.schemeDataURI @schemeDataURI ?]" schemeURI="[?merge $organization.Identifier.schemeURI @schemeURI ?]"><?merge $organization.Identifier.value ?></Identifier>
+        <?merge $organization.OrganizationDescriptiveMetadata.bool() ?>
+<OrganizationDescriptiveMetadata>
+    <?merge $organization.OrganizationDescriptiveMetadata.LegalClassification.bool() ?>
+    <LegalClassification><?merge $organization.OrganizationDescriptiveMetadata.LegalClassification ?></LegalClassification>
+    <?merge $organization.OrganizationDescriptiveMetadata.Name.bool() ?>
+    <Name><?merge $organization.OrganizationDescriptiveMetadata.Name ?></Name>
+    <?merge $organization.OrganizationDescriptiveMetadata.Address.array() ?>
+    <Address>
+        <CityName><?merge .CityName ?></CityName>
+        <Country><?merge .Country ?></Country>
+        <PostCode><?merge .PostCode ?></PostCode>
+        <PostOfficeBox><?merge .PostOfficeBox ?></PostOfficeBox>
+        <StreetName><?merge .StreetName ?></StreetName>
+    </Address>
+    <?merge $organization.OrganizationDescriptiveMetadata.Communication.array() ?>
+    <Communication>
+        <Channel><?merge .Channel ?></Channel>
+        <CompleteNumber><?merge .value ?></CompleteNumber>
+    </Communication>
+    <?merge $organization.OrganizationDescriptiveMetadata.Contact.array() ?>
+    <Contact>
+        <?merge .DepartmentName.bool() ?>
+        <DepartmentName><?merge .DepartmentName ?></DepartmentName>
+        <?merge .PersonName.bool() ?>
+        <PersonName><?merge .PersonName ?></PersonName>
+        <?merge .Communication ?>
+        <Communication>
+            <Channel><?merge .Channel ?></Channel>
+            <CompleteNumber><?merge .value ?></CompleteNumber>
+        </Communication>
+   	<?merge .Address ?>
+    	<Address>
+        	<CityName><?merge .CityName ?></CityName>
+        	<Country><?merge .Country ?></Country>
+		<PostCode><?merge .PostCode ?></PostCode>
+		<PostOfficeBox><?merge .PostOfficeBox ?></PostOfficeBox>
+		<StreetName><?merge .StreetName ?></StreetName>
+    	</Address>
+    </Contact>
+</OrganizationDescriptiveMetadata>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-descriptive.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-descriptive.xsd
new file mode 100644
index 00000000000..c31866cb892
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-descriptive.xsd
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+    <xsd:include schemaLocation="seda-2.0-types.xsd"/>
+    <xsd:include schemaLocation="seda-2.0-management.xsd"/>
+    <xsd:include schemaLocation="seda-2.0-ontology.xsd"/>
+    
+    <!-- Hierarchy and recursivity -->
+    <xsd:complexType name="ArchiveUnitType">
+        <xsd:annotation>
+            <xsd:documentation>Unité de base des métadonnées de description contenant la gestion de l'arborescence.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:element name="ArchiveUnitRefId" type="ArchiveUnitRefIdType">
+                <xsd:annotation>
+                    <xsd:documentation>Permet de faire une référence à d'autres ArchiveUnit dans la même transaction.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:sequence>
+                <xsd:element name="ArchiveUnitProfile" type="IdentifierType" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à une partie d'un profil d’archivage applicable à un ArchiveUnit en particulier. Permet par exemple de faire référence à une typologie documentaire dans un profil d'archivage.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="Management" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Métadonnées de gestion applicables à l’ArchiveUnit concernée et à ses héritiers.</xsd:documentation>
+                    </xsd:annotation>
+                    <xsd:complexType>
+                        <xsd:group ref="ManagementGroup"/>
+                    </xsd:complexType>
+                </xsd:element>
+                <xsd:element name="Content" type="DescriptiveMetadataContentType" minOccurs="1" maxOccurs="unbounded" >
+                    <xsd:annotation>
+                        <xsd:documentation>Métadonnées de description associées à un ArchiveUnit.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <!-- Hierarchy -->
+                <xsd:choice>
+                    <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                        <xsd:element name="ArchiveUnit" type="ArchiveUnitType">
+                            <xsd:annotation>
+                                <xsd:documentation>Gestion de la récursivité. Un &lt;ArchiveUnit&gt; peut être contenu dans un ature &lt;ArchiveUnit&gt;.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element ref="ArchiveUnitReferenceAbstract">
+                            <xsd:annotation>
+                                <xsd:documentation>Permet de faire référence à une sous unité d'archives, pouvant être déjà présente dans le système d'archivage provenant d'une transaction précédente.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="DataObjectReference" type="DataObjectRefType">
+                            <xsd:annotation>
+                                <xsd:documentation>Permet de faire référence à un objet-donnée binaire ou physique déjà présent dans les métadonnées du bordereau.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                    </xsd:choice>
+                </xsd:choice>
+            </xsd:sequence>
+        </xsd:choice>
+        <xsd:attribute name="id" type="ArchiveUnitIdType" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Identifiant de l'unité d'archives utilisé par exemple dans le cas de multiples héritages, pour savoir quel noeud contient une erreur.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- In ArchiveUnitType from seda-2.0-descriptive.xsd: Descriptive Metadata Content -->
+    <xsd:complexType name="DescriptiveMetadataContentType">
+        <xsd:annotation>
+            <xsd:documentation>Permet de définir les métadonnées de description. Peut être étendu.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="ObjectGroup"/>
+        </xsd:sequence>
+        <xsd:attribute name="restrictionRuleIdRef" type="xsd:IDREF" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>Permet d'indiquer les restrictions à appliquer sur le noeud. Si rien n'est spécifié, aucune restriction ne s'applique.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="restrictionValue" type="NonEmptyTokenType" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>Valeur de la restriction.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attribute name="restrictionEndDate" type="xsd:date" use="optional">
+            <xsd:annotation>
+                <xsd:documentation>Date de la fin de la restriction.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+        <xsd:attributeGroup ref="OpenTypeAttributeGroup"/>
+    </xsd:complexType>
+    
+</xsd:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-main.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-main.xsd
new file mode 100644
index 00000000000..08fd3763833
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-main.xsd
@@ -0,0 +1,816 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
+    <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+
+    <!--
+                *****************************
+                ***   Types de base
+                *****************************
+        -->
+    <xsd:include schemaLocation="seda-2.0-types.xsd"/>
+    <!--
+                *****************************
+                ***   Base technique
+                *****************************
+        -->
+    <xsd:include schemaLocation="seda-2.0-technical.xsd"/>
+    <!--
+                *****************************
+                ***   Base de gestion
+                *****************************
+        -->
+    <xsd:include schemaLocation="seda-2.0-management.xsd"/>
+    <!--
+                *****************************
+                ***   Base descriptive
+                *****************************
+        -->
+    <xsd:include schemaLocation="seda-2.0-descriptive.xsd"/>
+
+    <!--
+                *****************************
+                ***   Code List
+                *****************************
+ 
+        -->
+    <!-- Liste des versions des référentiels issue de MEDONA -->
+    <xsd:group name="TransportCodeListsGroup">
+        <xsd:annotation>
+            <xsd:documentation>Liste des codes de réponses souhaitée par l'expéditeur.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="ReplyCodeListGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Reply Code list -->
+    <xsd:group name="ReplyCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="ReplyCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Liste des codes de réponses à utiliser.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="ReplyCodeType">
+        <xsd:annotation>
+            <xsd:documentation>Code de réponses spécifié dans la liste de réponses.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+
+
+    <!-- Liste des versions des référentiels utilisés globalement -->
+    <xsd:complexType name="CodeListVersionsType">
+        <xsd:sequence>
+            <xsd:group ref="TransportCodeListsGroup"/>
+            <xsd:group ref="TechnicalCodeListsGroup"/>
+            <xsd:group ref="ManagementCodeListsGroup"/>
+            <xsd:element name="AuthorizationReasonCodeListVersion" type="CodeType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de codes d'autorisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="RelationshipCodeListVersion" type="CodeType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de codes des relations.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="OtherCodeListAbstract" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Permet d'ajouter de nouvelles listes de codes si l'ajout d'autres métadonnées l'impose.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute ref="xml:id" use="optional"/>
+    </xsd:complexType>
+
+    <!--
+                *****************************
+                ***   Types métier
+                *****************************
+ 
+        -->
+
+    <!-- Paquet d'Objets-données -->
+    <xsd:complexType name="DataObjectPackageType">
+        <xsd:sequence>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="BinaryDataObject" type="BinaryDataObjectType">
+                    <xsd:annotation>
+                        <xsd:documentation>Bloc de métadonnées techniques des objets-données numériques. Le caractère facultatif est requis afin de permettre le transfert d'un plan de classement sans DataObject joint.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="PhysicalDataObject" type="PhysicalDataObjectType">
+                    <xsd:annotation>
+                        <xsd:documentation>Bloc de métadonnées techniques des objets-données physiques.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+            <xsd:element name="DescriptiveMetadata" type="DescriptiveMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Bloc de métadonnées descriptives des objets-données.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ManagementMetadata" type="ManagementMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Bloc des métadonnées de gestion par défaut des objets-données.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute ref="xml:id" use="optional"/>
+    </xsd:complexType>
+
+    <!-- Métadonnées de gestion -->
+    <xsd:complexType name="ManagementMetadataType">
+        <xsd:sequence>
+            <xsd:element name="ArchivalProfile" type="IdentifierType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Profil d’archivage applicable aux ArchiveUnit.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ServiceLevel" type="IdentifierType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Niveau de service applicable aux unités d’archives.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:group ref="ManagementGroup" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées de gestion associées à l'ensemble des unités d'archives.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:group>
+        </xsd:sequence>
+        <xsd:attribute ref="xml:id" use="optional"/>
+    </xsd:complexType>
+
+    <!-- Demande d'autorisation -->
+    <xsd:complexType name="AuthorizationRequestContentType">
+        <xsd:sequence>
+            <xsd:element name="AuthorizationReason" type="xsd:token">
+                <xsd:annotation>
+                    <xsd:documentation>Motif de l'autorisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Comment" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Commentaire sur la transaction.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="RequestDate" type="xsd:date">
+                <xsd:annotation>
+                    <xsd:documentation>Date de la demande d'autorisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Requester" type="OrganizationType">
+                <xsd:annotation>
+                    <xsd:documentation>Demandeur de l'autorisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="AuthorizationRequestReply"
+                type="BusinessAuthorizationRequestReplyMessageType" minOccurs="0"
+                maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Réponse à la demande d’autorisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute ref="xml:id" use="optional"/>
+    </xsd:complexType>
+
+    <!--
+                ***************************** 
+                ***   Base de l'arborescence
+                *****************************
+        -->
+
+    <!-- Métadonnées descriptives pour un paquet d'Objets-données -->
+    <xsd:complexType name="DescriptiveMetadataType">
+        <xsd:sequence>
+            <xsd:element name="ArchiveUnit" type="ArchiveUnitType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Correspond à la notion de composant en ISAD(G). ArchiveUnit permet à la fois de gérer la hiérarchie intellectuelle, 
+                        tout en contenant les métadonnées de description et de gestion propres à chaque niveau de description archivistique.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!--
+                *****************************
+                ***   Déclaration des types de message
+                *****************************
+        -->
+
+    <!-- Message -->
+    <xsd:complexType name="MessageType" abstract="true">
+        <xsd:sequence>
+            <xsd:element name="Comment" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Commentaire sur le message.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Date" type="xsd:dateTime">
+                <xsd:annotation>
+                    <xsd:documentation>Date du message.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="MessageIdentifier" type="IdentifierType">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant du message.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Signature" type="SignatureType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Signature du message.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute ref="xml:id" use="optional"/>
+    </xsd:complexType>
+
+
+    <!-- Message métier -->
+    <xsd:complexType name="BusinessMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="MessageType">
+                <xsd:sequence>
+                    <xsd:element name="ArchivalAgreement" type="IdentifierType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Accord de service.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="CodeListVersions" type="CodeListVersionsType">
+                        <xsd:annotation>
+                            <xsd:documentation>Listes de codes de références utilisés dans le message.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="DataObjectPackage" type="DataObjectPackageType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Objets-données échangés dans le message.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de demande -->
+    <xsd:complexType name="BusinessRequestMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessMessageType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de demande d'autorisation -->
+    <xsd:complexType name="BusinessAuthorizationRequestMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="AuthorizationRequestContent"
+                        type="AuthorizationRequestContentType">
+                        <xsd:annotation>
+                            <xsd:documentation>Demande d’autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de reponse à une demande -->
+    <xsd:complexType name="BusinessReplyMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessMessageType">
+                <xsd:sequence>
+                    <xsd:element name="ReplyCode" type="NonEmptyTokenType" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Code de la réponse.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="MessageRequestIdentifier" type="IdentifierType">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de la demande.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de demande d'autorisation -->
+    <xsd:complexType name="BusinessAuthorizationRequestReplyMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessReplyMessageType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de notification -->
+    <xsd:complexType name="BusinessNotificationMessageType" abstract="true">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessMessageType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Défintion des organisations avec Id -->
+    <xsd:complexType name="OrganizationWithIdType">
+        <xsd:complexContent>
+            <xsd:extension base="OrganizationType">
+                <xsd:attribute ref="xml:id" use="optional"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+
+    <!--
+                *****************************
+                ***   Le message d'accusé de réception
+                *****************************
+        -->
+    <xsd:element name="Acknowledgement" type="AcknowledgementType">
+        <xsd:annotation>
+            <xsd:documentation>Accusé de réception d'un message.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="AcknowledgementType">
+        <xsd:complexContent>
+            <xsd:extension base="MessageType">
+                <xsd:sequence>
+                    <xsd:element name="MessageReceivedIdentifier" type="IdentifierType">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant du message reçu.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Sender" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Expéditeur du message.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Receiver" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Destinataire du message.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--
+                *****************************
+                ***   Les messages de requete
+                *****************************
+        -->
+    <!-- Message de demande de communication -->
+    <xsd:element name="ArchiveDeliveryRequest" type="ArchiveDeliveryRequestType">
+        <xsd:annotation>
+            <xsd:documentation>Demande de communication d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveDeliveryRequestType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="Derogation" type="xsd:boolean">
+                        <xsd:annotation>
+                            <xsd:documentation>Indique si une procédure de dérogation est nécessaire avant de communiquer l’unité documentaire ArchiveUnit.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la communication.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Requester" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Demandeur de la communication.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de demande de restitution -->
+    <xsd:element name="ArchiveRestitutionRequest" type="ArchiveRestitutionRequestType">
+        <xsd:annotation>
+            <xsd:documentation>Demande de restitution d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveRestitutionRequestType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la restitution.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur demandant la restitution.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de transfert (attention le paquet de données est facultatif)-->
+    <xsd:element name="ArchiveTransfer" type="ArchiveTransferType">
+        <xsd:annotation>
+            <xsd:documentation>Transfert d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveTransferType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="RelatedTransferReference" type="IdentifierType" minOccurs="0"
+                        maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant d’un transfert associé.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferRequestReplyIdentifier" type="IdentifierType"
+                        minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de la réponse à une demande de transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable du transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferringAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service versant chargé de réaliser le transport.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de demande de transfert -->
+    <xsd:element name="ArchiveTransferRequest" type="ArchiveTransferRequestType">
+        <xsd:annotation>
+            <xsd:documentation>Demande de transfert d’archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveTransferRequestType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="RelatedTransferReference" type="IdentifierType" minOccurs="0"
+                        maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Référence à un transfert d'archives lié.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferDate" type="xsd:dateTime" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Date retenue pour le transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable du transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferringAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service versant responsable du transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--
+                *****************************
+                ***   Les messages de demande d'autorisation
+                *****************************
+        -->
+    <!-- Message de demande d'autorisation au service de contrôle -->
+    <xsd:element name="AuthorizationControlAuthorityRequest"
+        type="AuthorizationControlAuthorityRequestType">
+        <xsd:annotation>
+            <xsd:documentation>Demande d'autorisation au service de contrôle.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="AuthorizationControlAuthorityRequestType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessAuthorizationRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la demande d'autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ControlAuthority" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Autorité de contrôle.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de demande d'autorisation au service producteur -->
+    <xsd:element name="AuthorizationOriginatingAgencyRequest"
+        type="AuthorizationOriginatingAgencyRequestType">
+        <xsd:annotation>
+            <xsd:documentation>Demande d'autorisation au service producteur.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="AuthorizationOriginatingAgencyRequestType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessAuthorizationRequestMessageType">
+                <xsd:sequence>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la demande d'autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur responsable de l’instruction de la demande d’autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--
+                ***************************** 
+				                ***   Les messages de reponse à une requete
+                *****************************
+        -->
+    <!-- Message de réponse à une demande de communication -->
+    <xsd:element name="ArchiveDeliveryRequestReply" type="ArchiveDeliveryRequestReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse à une demande de communication d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveDeliveryRequestReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="AuthorizationRequestReplyIdentifier" type="IdentifierType"
+                        minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de la réponse à une demande d’autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la demande de communication.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Requester" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Demandeur de la communication.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de réponse à une demande de restitution -->
+    <xsd:element name="ArchiveRestitutionRequestReply" type="ArchiveRestitutionRequestReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse à une demande de restitution d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveRestitutionRequestReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la demande de restitution.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur responsable de la demande de restitution.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de réponse à un transfert -->
+    <xsd:element name="ArchiveTransferReply" type="ArchiveTransferReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse à un transfert d'archives (acceptation, rejet, anomalie..).</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveTransferReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="GrantDate" type="xsd:dateTime" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Date de prise en charge effective du transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la réponse à un transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferringAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service versant responsable de la réponse à un transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de réponse à une demande de transfert -->
+    <xsd:element name="ArchiveTransferRequestReply" type="ArchiveTransferRequestReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse à une demande de transfert d’archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveTransferRequestReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="TransferDate" type="xsd:dateTime" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Date de transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la réponse à une demande de transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="TransferringAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service versant responsable de la réponse à une demande de transfert.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!--
+                *****************************
+                ***   Les messages de reponse à une demande d'autorisation
+                *****************************
+        -->
+    <!-- Message de réponse à une demande d'autorisation au service de contrôle -->
+    <xsd:element name="AuthorizationControlAuthorityRequestReply"
+        type="AuthorizationControlAuthorityRequestReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse donnée à une demande d'autorisation au service de contrôle.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="AuthorizationControlAuthorityRequestReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessAuthorizationRequestReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la réponse à une demande d'autorisation à un service de contrôle.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ControlAuthority" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service de contrôle responsable de la réponse à une demande d'autorisation à un service de contrôle.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <!-- Message de réponse à une demande d'autorisation au service producteur -->
+    <xsd:element name="AuthorizationOriginatingAgencyRequestReply"
+        type="AuthorizationOriginatingAgencyRequestReplyType">
+        <xsd:annotation>
+            <xsd:documentation>Réponse donnée à une demande d'autorisation au service producteur.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="AuthorizationOriginatingAgencyRequestReplyType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessAuthorizationRequestReplyMessageType">
+                <xsd:sequence>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d’archives à l’origine de la demande d’autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur responsable de l’instruction de la demande d’autorisation.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!--
+                *****************************
+                ***   Les messages de notification
+                *****************************
+        -->
+    <!-- Message de notification d'élimination -->
+    <xsd:element name="ArchiveDestructionNotification" type="ArchiveDestructionNotificationType">
+        <xsd:annotation>
+            <xsd:documentation>Notification d'élimination d'archives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveDestructionNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessNotificationMessageType">
+                <xsd:sequence>
+                    <xsd:element name="AuthorizationRequestReplyIdentifier" type="IdentifierType">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de la réponse à une demande d'autorisation d'élimination.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la notification d'élimination.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur responsable de la notification d'élimination.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Message de notification de modification -->
+    <xsd:element name="ArchiveModificationNotification" type="ArchiveModificationNotificationType">
+        <xsd:annotation>
+            <xsd:documentation>Notification de modification d'archives (format ou métadonnées).</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    <xsd:complexType name="ArchiveModificationNotificationType">
+        <xsd:complexContent>
+            <xsd:extension base="BusinessNotificationMessageType">
+                <xsd:sequence>
+                    <xsd:element name="UnitIdentifier" type="IdentifierType" maxOccurs="unbounded">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant de l'unité documentaire.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="ArchivalAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service d'archives responsable de la notification de modification.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="OriginatingAgency" type="OrganizationWithIdType">
+                        <xsd:annotation>
+                            <xsd:documentation>Service producteur responsable de la notification de modification.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+</xsd:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-management.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-management.xsd
new file mode 100644
index 00000000000..2c1a6f45523
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-management.xsd
@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+    targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+    <xsd:include schemaLocation="seda-2.0-types.xsd"/>
+    
+    <!--
+                *****************************
+                ***   Code List
+                *****************************
+ 
+        -->
+    <xsd:group name="ManagementCodeListsGroup">
+        <xsd:annotation>
+            <xsd:documentation>Listes de codes nécessaires dans les métadonnées de gestion.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="StorageRuleCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="AppraisalRuleCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="AccessRuleCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="DisseminationRuleCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="ReuseRuleCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="ClassificationRuleCodeListGroup" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Management Lists and Codes -->
+    <xsd:complexType name="RuleIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant de la règle de gestion.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:simpleContent>
+            <xsd:extension base="NonEmptyTokenType">
+                <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    
+    <xsd:group name="AccessRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="AccessRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de communicabilité.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <xsd:group name="DisseminationRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="DisseminationRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de diffusion.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <xsd:group name="ReuseRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="ReuseRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de réutilisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <xsd:group name="ClassificationRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="ClassificationRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de classification.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <xsd:group name="AppraisalRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="AppraisalRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de durée d'utilité administrative.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <xsd:group name="StorageRuleCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="StorageRuleCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version des listes de codes pour les règles de durée d'utilité courante.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <!-- Management content -->
+    <xsd:group name="ManagementGroup">
+        <xsd:annotation>
+            <xsd:documentation>Contient les métadonnées de gestion.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="StorageRule" type="StorageRuleType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la durée d’utilité courante.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="AppraisalRule" type="AppraisalRuleType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la durée d’utilité administrative.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="AccessRule" type="AccessRuleType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la communicabilité.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="DisseminationRule" type="DisseminationRuleType"
+                minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la diffusion.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ReuseRule" type="ReuseRuleType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la réutilisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ClassificationRule" type="ClassificationRuleType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Gestion de la classification.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="NeedAuthorization" type="xsd:boolean" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Indique si une autorisation humaine est nécessaire pour vérifier ou valider les opérations de gestion des ArchiveUnit.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="OtherManagementAbstract" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Autres métadonnées de gestion.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <!-- Example of codification of one Rule Code oustide SEDA in an external referential -->
+    <xsd:complexType name="DurationRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Permet d'exprimer pour une règle de gestion quelles informations doivent en découler.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="RuleId" type="RuleIdType">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de la règle</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Value" type="MeasurementDurationType"/>
+            <xsd:element name="Description" type="xsd:string"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:simpleType name="MeasurementDurationUnitsType">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="day"/>
+            <xsd:enumeration value="DAY"/>
+            <xsd:enumeration value="month"/>
+            <xsd:enumeration value="MON"/>
+            <xsd:enumeration value="year"/>
+            <xsd:enumeration value="ANN"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:complexType name="MeasurementDurationType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:nonNegativeInteger">
+                <xsd:attribute name="unit" type="MeasurementDurationUnitsType" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+        
+    <!-- Global inheritance control -->
+    <xsd:group name="PreventInheritanceGroup">
+        <xsd:choice>
+            <xsd:element name="PreventInheritance" type="xsd:boolean" default="false" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Indique si les règles de gestion héritées des ArchiveUnit parents doivent être ignorées pour l’ArchiveUnit concerné.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:group>
+    
+    <xsd:complexType name="AccessRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la communicabilité.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la date de fin d'application de la règle peut être calculée et comparée avec la date courante..</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de communicabilité.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de la règle de communicabilité.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>Identifiant de la règle à désactiver à partir de cette ArchiveUnit.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:complexType name="DisseminationRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la diffusion.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la règle est valable (restriction appliquée).</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de diffusion.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de la règle de diffusion.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:complexType name="ReuseRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la réutilisation.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la règle est valable (restriction appliquée).</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de réutilisation.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de la règle de réutilisation.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:complexType name="ClassificationRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la classification.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la règle est valable (restriction appliquée).</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de classification.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de la règle de classification.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+            <xsd:element name="ClassificationLevel" type="NonEmptyTokenType">
+                <xsd:annotation>
+                    <xsd:documentation>Référence au niveau de classification.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ClassificationOwner" type="NonEmptyTokenType">
+                <xsd:annotation>
+                    <xsd:documentation>Propriétaire de la classification. Service émetteur au sens de l’IGI 1300.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ClassificationReassessingDate" type="xsd:date" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de réévaluation de la classification.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="NeedReassessingAuthorization" type="xsd:boolean" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Indique si une autorisation humaine est nécessaire pour réévaluer la classification.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:simpleType name="FinalActionStorageCodeType">
+        <xsd:annotation>
+            <xsd:documentation>Code correspondant à l’action à entreprendre au terme de la durée d’utilité courante.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType">
+            <xsd:enumeration value="RestrictAccess"/>
+            <xsd:enumeration value="Transfer"/>
+            <xsd:enumeration value="Copy"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:complexType name="StorageRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la durée d'utilité courante.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la règle est valable (restriction appliquée).</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de durée d'utilité courante.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de la règle d'utilité courante.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+            <xsd:element name="FinalAction" type="FinalActionStorageCodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Action à mettre en œuvre au terme de la durée de gestion.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <xsd:simpleType name="FinalActionAppraisalCodeType">
+        <xsd:annotation>
+            <xsd:documentation>Code correspondant à l’action à entreprendre au terme de la durée d’utilité administrative.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType">
+            <xsd:enumeration value="Keep"/>
+            <xsd:enumeration value="Destroy"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:complexType name="AppraisalRuleType">
+        <xsd:annotation>
+            <xsd:documentation>Gestion de la durée d'utilité administrative.</xsd:documentation>
+            <xsd:documentation>Chaque règle a une startDate et un Identifiant de règle de référence pour la durée.
+                Si aucune règle n'est spécifiée et que la date actuelle est dans la StarDate, la réponse de restriction est "Aucune restriction".
+                Si la date est vide, la réponse de restriction est "Restreint" car il n'y a aucun moyen de calculer la date de fin.
+                Si une règle et une date sont précisées, alors la règle est valable (restriction appliquée).</xsd:documentation>
+            <xsd:documentation>La liste d'identifiants de règles à appliquer et à ignorer qui doit être appliquée à partir de cet ArchiveUnit.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="Rule" type="RuleIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à la règle de durée d'utilité administrative.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="StartDate" type="xsd:date" nillable="true" minOccurs="0">
+                    <xsd:annotation>
+                        <xsd:documentation>Date de départ de calcul de durée d'utilité administrative.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:sequence>
+            <xsd:choice minOccurs="0">
+                <xsd:group ref="PreventInheritanceGroup"/>
+                <xsd:element name="RefNonRuleId" type="RuleIdType" maxOccurs="unbounded">
+                    <xsd:annotation>
+                        <xsd:documentation>L'identifiant de la règle spécifiée pourra être retirée de l'héritage dans ce noeud.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+            <xsd:element name="FinalAction" type="FinalActionAppraisalCodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Action à mettre en œuvre au terme de la durée de gestion.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+</xsd:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-ontology.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-ontology.xsd
new file mode 100644
index 00000000000..5b64db27984
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-ontology.xsd
@@ -0,0 +1,950 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    xmlns:pr="info:lc/xmlns/premis-v2" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0" elementFormDefault="qualified"
+    attributeFormDefault="unqualified" version="1.0">
+    <xsd:include schemaLocation="seda-2.0-types.xsd"/>
+
+    <xsd:group name="ObjectGroup">
+        <xsd:annotation>
+            <xsd:documentation>Contient les éléments nécessaires à
+                la description de l'ArchiveUnit et est sensé être la racine du bloc des métadonnées de
+                description.</xsd:documentation>
+            <xsd:documentation>Chaque sous-type ou sous-groupe peut aussi être utilisé pour
+                construire de nouveaux types ou groupes.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="BaseObjectGroup"/>
+            <xsd:element ref="ObjectGroupExtenstionAbstract" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <xsd:group name="BaseObjectGroup">
+        <xsd:sequence>
+            <xsd:group ref="LevelGroup" minOccurs="1"/>
+            <xsd:group ref="TitleGroup" minOccurs="1"/>
+            <xsd:group ref="IdentifierGroup"/>
+            <xsd:group ref="DescriptionGroup"/>
+            <xsd:group ref="CustodialHistoryGroup"/>
+            <xsd:group ref="TypeGroup"/>
+            <xsd:group ref="DocumentTypeGroup"/>
+            <xsd:group ref="LanguageGroup"/>
+            <xsd:group ref="StatusGroup"/>
+            <xsd:group ref="VersionGroup"/>
+            <xsd:group ref="KeywordsGroup"/>
+            <xsd:group ref="CoverageGroup"/>
+            <xsd:group ref="OriginatingAgencyGroup"/>
+            <xsd:group ref="SubmissionAgencyGroup"/>
+            <xsd:group ref="AuthorizedAgentGroup"/>
+            <xsd:group ref="WritingGroup"/>
+            <xsd:group ref="AudienceGroup"/>
+            <xsd:group ref="SourceGroup"/>
+            <xsd:group ref="RelationGroup"/>
+            <xsd:group ref="DateGroup"/>
+            <xsd:group ref="EventGroup"/>
+            <xsd:group ref="SignatureGroup"/>
+            <xsd:group ref="GpsGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Level description -->
+    <xsd:group name="LevelGroup">
+        <xsd:sequence>
+            <xsd:element name="DescriptionLevel" type="LevelType" minOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>Niveau de description au sens de la norme ISAD (G). Indique si l’ArchiveUnit correspond à un fonds, 
+                        à un sous-fonds, à une classe, à une série organique, à une sous-série organique, à un dossier, à un sous-dossier ou à une pièce.</xsd:documentation>
+                    <xsd:documentation>Référence : seda.DescriptionLevel</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="LevelType">
+        <xsd:annotation>
+            <xsd:documentation>Valeurs de DescriptionLevel.</xsd:documentation>
+            <xsd:documentation>Références : descriptionlevel_code SEDA 1.0</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:token">
+            <xsd:enumeration value="Fonds"/>
+            <xsd:enumeration value="Subfonds"/>
+            <xsd:enumeration value="Class"/>
+            <xsd:enumeration value="Collection"/>
+            <xsd:enumeration value="Series"/>
+            <xsd:enumeration value="Subseries"/>
+            <xsd:enumeration value="RecordGrp"/>
+            <xsd:enumeration value="SubGrp"/>
+            <xsd:enumeration value="File"/>
+            <xsd:enumeration value="Item"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!-- Title description -->
+    <xsd:group name="TitleGroup">
+        <xsd:sequence>
+            <xsd:element name="Title" type="TextType" minOccurs="1" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Intitulé de l'ArchiveUnit.</xsd:documentation>
+                    <xsd:documentation>Références : DC.Title ead.unittitle</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <!-- Identification description -->
+    <xsd:group name="IdentifierGroup">
+        <xsd:sequence>
+            <xsd:element name="FilePlanPosition" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Position de l’ArchiveUnit dans le plan de classement du service producteur.</xsd:documentation>
+                    <xsd:documentation>Références : seda.FilePlanPosition</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="SystemId" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant attribué aux objets. Il est attribué par le SAE et correspond à un identifiant interne.</xsd:documentation>
+                    <xsd:documentation>Références : ARMS</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="OriginatingSystemId" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant système attribué à l’ArchiveUnit par l’application du service producteur.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ArchivalAgencyArchiveUnitIdentifier" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant métier attribué à l'ArchiveUnit par le service d'archives. Peut être comparé à une cote.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="OriginatingAgencyArchiveUnitIdentifier" type="NonEmptyTokenType"
+                minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant métier attribué à l’ArchiveUnit par le service producteur.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="TransferringAgencyArchiveUnitIdentifier" type="NonEmptyTokenType"
+                minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant attribué à l'ArchiveUnit par le service versant.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- General description -->
+    <xsd:group name="DescriptionGroup">
+        <xsd:sequence>
+            <xsd:element name="Description" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Description détaillée de l’ArchiveUnit. Correspond à la présentation du contenu au sens de la norme ISAD(G).</xsd:documentation>
+                    <xsd:documentation>Références : DC:Documentation</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- CustodialHistory type -->
+    <xsd:group name="CustodialHistoryGroup">
+        <xsd:sequence>
+            <xsd:element name="CustodialHistory" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Énumère les changements successifs de propriété, de responsabilité et de conservation des ArchiveUnit avant 
+                        leur entrée dans le lieu de conservation. On peut notamment y indiquer comment s'est effectué le passage de l'application 
+                        d'origine au fichier archivable. Correspond à l'historique de la conservation en ISAD(G).</xsd:documentation>
+                    <xsd:documentation>Références : seda.CustodialHistory</xsd:documentation>
+                </xsd:annotation>
+               <xsd:complexType>
+                   <xsd:sequence>
+                       <xsd:element name="CustodialHistoryItem" minOccurs="1" maxOccurs="unbounded">
+                           <xsd:annotation>
+                               <xsd:documentation>Description d'une période ou d'un événement précis dans l'historique.</xsd:documentation>
+                               <xsd:documentation>Références : seda.CustodialHistoryItem</xsd:documentation>
+                           </xsd:annotation>
+                           <xsd:complexType>
+                               <xsd:complexContent>
+                                   <xsd:extension base="TextType">
+                                       <xsd:attribute name="when" type="DateType" use="optional"/>
+                                   </xsd:extension>
+                               </xsd:complexContent>
+                           </xsd:complexType>
+                       </xsd:element>
+                       <xsd:element name="CustodialHistoryFile" type="DataObjectRefType" minOccurs="0">
+                           <xsd:annotation>
+                               <xsd:documentation>Référence à un fichier de journalisation externe.</xsd:documentation>
+                           </xsd:annotation>
+                       </xsd:element>
+                   </xsd:sequence>
+               </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- OAIS type description -->
+    <xsd:group name="TypeGroup">
+        <xsd:sequence>
+            <xsd:element name="Type" type="TextType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Type d’information au sens de l’OAIS (information de représentation, information de pérennisation, etc.).</xsd:documentation>
+                    <xsd:documentation>Références : seda.DocumentType</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Document type description -->
+    <xsd:group name="DocumentTypeGroup">
+        <xsd:sequence>
+            <xsd:element name="DocumentType" type="TextType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Type de document au sens diplomatique du terme (ex. compte-rendu de réunion, note, correspondance, etc.). Ne pas confondre avec Type.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Language description -->
+    <xsd:group name="LanguageGroup">
+        <xsd:sequence>
+            <xsd:element name="Language" type="xsd:language" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Langue du contenu des objets-données.</xsd:documentation>
+                    <xsd:documentation>Références : seda.Language</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="DescriptionLanguage" type="xsd:language" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Langue utilisée pour les informations de représentation et de pérennisation.</xsd:documentation>
+                    <xsd:documentation>Références : seda.DescriptionLanguage</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Status description -->
+    <xsd:group name="StatusGroup">
+        <xsd:sequence>
+            <xsd:element name="Status" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Etat de l'objet-données (par rapport avec son cycle de vie). Permet par exemple d'indiquer si la signature du fichier a été vérifiée avant le transfert aux archives.</xsd:documentation>
+                    <xsd:documentation>Références : seda.Status</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Version description -->
+    <xsd:group name="VersionGroup">
+        <xsd:sequence>
+            <xsd:element name="Version" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Permet d'indiquer quelle est la version du document.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Keywords description -->
+    <xsd:group name="KeywordsGroup">
+        <xsd:sequence>
+            <xsd:element name="Tag" type="NonEmptyTokenType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Mots-clés ou liste de mots-clés génériques. En ce qui concerne l'indexation, on pourra utiliser Tag ou Keyword en fonction de ce que l'on souhaite décrire.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Keyword" type="KeywordsType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Mots-clef avec contexte inspiré du SEDA 1.0. En ce qui concerne l'indexation, on pourra utiliser Tag ou Keyword en fonction de ce que l'on souhaite décrire.</xsd:documentation>
+                    <xsd:documentation>Références : seda.Keyword</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Repris du SEDA 1.0 -->
+    <xsd:complexType name="KeywordsType">
+        <xsd:annotation>
+            <xsd:documentation>Mots-clés.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="KeywordContent" type="TextType">
+                <xsd:annotation>
+                    <xsd:documentation>Valeur du mot-clé. A utiliser avec Keyword.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="KeywordReference" type="IdentifierType" minOccurs="0" maxOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant du mot clé dans un référentiel donné. Par exemple, pour un lieu, il pourrait s'agir de son code officiel géographique selon l'INSEE.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="KeywordType" minOccurs="0" maxOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>Type de mot clé.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:simpleContent>
+                        <xsd:extension base="CodeKeywordType">
+                            <xsd:attribute name="listVersionID" type="xsd:token" use="optional"
+                                default="edition 2009">
+                            </xsd:attribute>
+                        </xsd:extension>
+                    </xsd:simpleContent>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+    </xsd:complexType>
+    <!-- =============================================================== -->
+    <!-- ===== Code List KeywordType: KeywordType Code           ======= -->
+    <!-- =============================================================== -->
+    <xsd:simpleType name="CodeKeywordType">
+        <xsd:annotation>
+            <xsd:documentation xml:lang="fr">Table des types de mots-clés.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:token">
+            <xsd:enumeration value="corpname">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Collectivité.</xsd:documentation>
+                    <xsd:documentation>Références : ead.corpname</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="famname">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Nom de famille.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="geogname">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Nom géographique.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="name">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Nom.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="occupation">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Fonction.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="persname">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Nom de personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="subject">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Mot-matière.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="genreform">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Type de document.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+            <xsd:enumeration value="function">
+                <xsd:annotation>
+                    <xsd:documentation xml:lang="fr">Activité.</xsd:documentation>
+                    <xsd:documentation xml:lang="fr">Références : ead.function</xsd:documentation>
+                </xsd:annotation>
+            </xsd:enumeration>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <!-- Coverage description -->
+    <xsd:group name="CoverageGroup">
+        <xsd:sequence>
+            <xsd:element name="Coverage" type="CoverageType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Couverture spatiale, temporelle ou juridictionnelle de l’ArchiveUnit</xsd:documentation>
+                    <xsd:documentation>Références : DC.Coverage</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="CoverageType">
+        <xsd:sequence>
+            <xsd:element name="Spatial" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Couverture spatiale ou couverture géographique.</xsd:documentation>
+                    <xsd:documentation>Références: AGKRMS.spatialCoverage</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Temporal" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Couverture temporelle.</xsd:documentation>
+                    <xsd:documentation>Références: AGKRMS.temporalCoverage</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Juridictional" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Juridiction administrative ou ressort administratif.</xsd:documentation>
+                    <xsd:documentation>Références: AGKRMS.juridictionalCoverage</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <!-- OriginatingAgency description -->
+    <xsd:group name="OriginatingAgencyGroup">
+        <xsd:sequence>
+            <xsd:element name="OriginatingAgency" type="OrganizationType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Service producteur. "Personne physique ou morale, publique ou privée, qui a produit, reçu et conservé des archives  dans l'exercice de son activité", Dictionnaire de terminologie archivistique, direction des archives de France, 2002.</xsd:documentation>
+                    <xsd:documentation>Références : seda.OriginatingAgency</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- SubmissionAgency description -->
+    <xsd:group name="SubmissionAgencyGroup">
+        <xsd:sequence>
+            <xsd:element name="SubmissionAgency" type="OrganizationType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Service versant responsable du transfert des données.</xsd:documentation>
+                    <xsd:documentation>Références : seda.SubmissionAgency</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <!-- Proxy description -->
+    <xsd:group name="AuthorizedAgentGroup">
+        <xsd:sequence>
+            <xsd:element name="AuthorizedAgent" type="AgentType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Titulaire des droits de propriété intellectuelle.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Writing description -->
+    <xsd:group name="WritingGroup">
+        <xsd:sequence>
+            <xsd:annotation>
+                <xsd:documentation>Rédacteur de l'objet d'archive.</xsd:documentation>
+            </xsd:annotation>
+            <xsd:element name="Writer" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Rédacteur Rédacteur de l’ArchiveUnit.</xsd:documentation>
+                    <xsd:documentation>Références : interpares.Writer</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:group ref="WriterGroup"/>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:group name="WriterGroup">
+        <xsd:sequence>
+            <xsd:group ref="PersonGroup"/>
+            <xsd:group ref="BusinessGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+    
+
+    <!-- Audience description -->
+    <xsd:group name="AudienceGroup">
+        <xsd:sequence>
+            <xsd:annotation>
+                <xsd:documentation>Audience du document. Permet de gérer les questions de "diffusion restreinte", de "spécial France" et de "Confidentiel Industrie".</xsd:documentation>
+            </xsd:annotation>
+            <xsd:group ref="AddresseeGroup"/>
+            <xsd:group ref="RecipientGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Source description -->
+    <xsd:group name="SourceGroup">
+        <xsd:sequence>
+            <xsd:element name="Source" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En cas de substitution numérique, permet de faire référence au papier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Relation description -->
+    <xsd:group name="RelationGroup">
+        <xsd:annotation>
+            <xsd:documentation>Les valeurs sont des identifiants au choix : - d'un autre objet données (DataObjectRefIdType ou GroupIdType s'ils sont dans le même transfert, ou identifiant dans le SAE sinon) - d'un autre ArchiveUnit (ArchiveUnitRefIdType s'il est dans le même transfert, ou identifiant dans le SAE sinon).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="RelatedObjectReference" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Référence à un objet faisant ou ne faisant pas partie du présent paquet d'information.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="IsVersionOf" type="DataObjectOrArchiveUnitReferenceType"
+                            minOccurs="0" maxOccurs="unbounded">
+                            <xsd:annotation>
+                                <xsd:documentation>Est une version de. Edition, adaptation, traduction. Cette relation permet d'indiquer les modifications dans le contenu.</xsd:documentation>
+                                <xsd:documentation>Références : DC.Relation.isVersionOf</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="Replaces" type="DataObjectOrArchiveUnitReferenceType" minOccurs="0"
+                            maxOccurs="unbounded">
+                            <xsd:annotation>
+                                <xsd:documentation>Remplace. Cette relation permet d'indiquer les objets remplacés par le niveau courant de description.</xsd:documentation>
+                                <xsd:documentation>DC.Relation.replaces</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="Requires" type="DataObjectOrArchiveUnitReferenceType" minOccurs="0"
+                            maxOccurs="unbounded">
+                            <xsd:annotation>
+                                <xsd:documentation>Requiert. Cette relation permet d'indiquer les objets nécessaire à la compréhension du niveau courant de description.</xsd:documentation>
+                                <xsd:documentation>Références : DC.Relation.requires</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="IsPartOf" type="DataObjectOrArchiveUnitReferenceType" minOccurs="0"
+                            maxOccurs="unbounded">
+                            <xsd:annotation>
+                                <xsd:documentation>Est une partie de. Cette relation permet d'indique qu'un objet est une partie d'un autre.</xsd:documentation>
+                                <xsd:documentation>Références : DC.Relation.isPartOf</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="References" type="DataObjectOrArchiveUnitReferenceType" minOccurs="0"
+                            maxOccurs="unbounded">
+                            <xsd:annotation>
+                                <xsd:documentation>Référence. Cette relation permet d'indiquer qu'un objet en référence un autre.</xsd:documentation>
+                                <xsd:documentation>DC.Relation.references</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="DataObjectOrArchiveUnitReferenceType">
+        <xsd:choice>
+            <xsd:element name="ArchiveUnitRefId" type="ArchiveUnitRefIdType">
+                <xsd:annotation>
+                    <xsd:documentation>Référence à un ArchiveUnit interne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="DataObjectReference" type="DataObjectRefType">
+                <xsd:annotation>
+                    <xsd:documentation>Référence à un objet-données ou à un groupe d'objets-données interne(s).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="RepositoryArchiveUnitPID" type="NonEmptyTokenType">
+                <xsd:annotation>
+                    <xsd:documentation>Référence à un ArchiveUnit déjà conservé dans un système d'archivage.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="RepositoryObjectPID" type="NonEmptyTokenType">
+                <xsd:annotation>
+                    <xsd:documentation>Référence à un un objet-données ou à un groupe d'objets-données déjà conservé(s) dans un système d'archivage.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:complexType>
+    <!-- Date description -->
+    <xsd:group name="DateGroup">
+        <xsd:sequence>
+            <xsd:element name="CreatedDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de création.</xsd:documentation>
+                    <xsd:documentation>Références : ARKMS.DateCreated</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="TransactedDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de la transaction.</xsd:documentation>
+                    <xsd:documentation>Références : ARKMS.DateTransacted</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="AcquiredDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de numérisation.</xsd:documentation>
+                    <xsd:documentation>Références : ARKMS.DateAcquired</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="SentDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date d'envoi.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="ReceivedDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de réception.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="RegisteredDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date d'enregistrement.</xsd:documentation>
+                    <xsd:documentation>Références : ARMS.DateDeclared</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="StartDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date d'ouverture / date de début.</xsd:documentation>
+                    <xsd:documentation>Références : AGKRMS.StartDate</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="EndDate" type="DateType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de fermeture / Date de fin.</xsd:documentation>
+                    <xsd:documentation>Références : AGKRMS.EndDate</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="DateType">
+        <xsd:union memberTypes="xsd:date xsd:dateTime"/>
+    </xsd:simpleType>
+    <!-- Event description -->
+    <xsd:group name="EventGroup">
+        <xsd:sequence>
+            <xsd:element name="Event" type="EventType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Informations décrivant un événement survenu au cours d’une procédure (ex. publication d’un marché, notification d’un marché, recueil d’un avis administratif, etc.).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="EventType">
+        <xsd:sequence>
+            <xsd:element name="EventIdentifier" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de l'événement.</xsd:documentation>
+                    <xsd:documentation>Références : premis.eventIdentifier</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="EventType" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Type d'événement.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="EventDateTime" type="xsd:dateTime">
+                <xsd:annotation>
+                    <xsd:documentation>Date et heure de l'événement.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="EventDetail" type="TextType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Détail sur l'événement.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    <!-- Signature description -->
+    <xsd:group name="SignatureGroup">
+        <xsd:sequence>
+            <xsd:element name="Signature" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Contient toutes les informations relatives à la signature.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="DateSignature" type="xsd:dateTime">
+                            <xsd:annotation>
+                                <xsd:documentation>Date de l'objet signature.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="Signer">
+                            <xsd:annotation>
+                                <xsd:documentation>Signataire(s) de la transaction ou de l'objet.</xsd:documentation>
+                                <xsd:documentation>Références : premis.signer</xsd:documentation>
+                            </xsd:annotation>
+                            <xsd:complexType>
+                                <xsd:group ref="SignerGroup"/>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="Validator">
+                            <xsd:annotation>
+                                <xsd:documentation>Validateur de la signature.</xsd:documentation>
+                            </xsd:annotation>
+                            <xsd:complexType>
+                                <xsd:group ref="ValidatorGroup"/>
+                            </xsd:complexType>
+                        </xsd:element>
+                        <xsd:element name="Masterdata" type="CodeType" minOccurs="0">
+                            <xsd:annotation>
+                                <xsd:documentation>Référentiel des personnes et des organisations au moment de la vérification de la signature et de sa validation.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="ReferencedObject" type="ReferencedObjectType">
+                            <xsd:annotation>
+                                <xsd:documentation>Référence à l'objet signé.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="ReferencedObjectType">
+        <xsd:annotation>
+            <xsd:documentation>Contient la référence à l'objet signé (et son empreinte jusqu'à la fin de la phase de versement dans le SAE).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="SignedObjectId" type="DataObjectRefIdType">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de l'objet-données signé.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="SignedObjectDigest" type="MessageDigestBinaryObjectType">
+                <xsd:annotation>
+                    <xsd:documentation>Empreinte obligatoire jusqu'au processus de versement pour assurer la portabilité de la valeur probante. Le SAE peut ne pas la conserver si l'on considère que l'identifiant de l'objet correspondant suffit. Ce procédé permet de résister au temps lorsque les informations binaires du paquet seront converties au gré des opérations de préservation de la lisibilité des formats. Au cours de ces opérations, l'identifiant ne changera pas, contrairement au format dufichier et donc à son empreinte.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:group name="SignerGroup">
+        <xsd:sequence>
+            <xsd:group ref="PersonOrEntityGroup"/>
+            <xsd:element name="SigningTime" type="xsd:dateTime">
+                <xsd:annotation>
+                    <xsd:documentation>Date de signature.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:group ref="BusinessGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:group name="ValidatorGroup">
+        <xsd:sequence>
+            <xsd:group ref="PersonOrEntityGroup"/>
+            <xsd:element name="ValidationTime" type="xsd:dateTime">
+                <xsd:annotation>
+                    <xsd:documentation>Date de la validation de la signature.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:group ref="BusinessGroup"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Addressee description -->
+    <xsd:group name="AddresseeGroup">
+        <xsd:sequence>
+            <xsd:element name="Addressee" minOccurs="0" maxOccurs="unbounded" type="AgentType">
+                <xsd:annotation>
+                    <xsd:documentation>Destinataire pour action. Utilisé pour indiquer le nom du destinatire par exemple dans un courrier électronique.</xsd:documentation>
+                    <xsd:documentation>Références : ARMS.Addressee, Interpares.Addressee</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Recipient description -->
+    <xsd:group name="RecipientGroup">
+        <xsd:sequence>
+            <xsd:element name="Recipient" minOccurs="0" maxOccurs="unbounded" type="AgentType">
+                <xsd:annotation>
+                    <xsd:documentation>Destinataire pour information. Utilisé pour indiquer le nom du destinatire en copie, pour information, par exemple dans un courrier électronique.</xsd:documentation>
+                    <xsd:documentation>Références : Interpares.Recipient</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Person description -->
+    <xsd:group name="PersonGroup">
+        <xsd:sequence>
+            <xsd:element name="FirstName" type="xsd:string">
+                <xsd:annotation>
+                    <xsd:documentation>Prénom d'une personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="BirthName" type="xsd:string">
+                <xsd:annotation>
+                    <xsd:documentation>Nom de naissance d'une personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GivenName" type="xsd:string" minOccurs="0" maxOccurs="1">
+                <xsd:annotation>
+                    <xsd:documentation>Nom d'usage d'une personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Gender" type="NonEmptyTokenType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Sexe de la personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="BirthDate" type="xsd:date" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de naissance de la personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="BirthPlace" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Lieu de naissance de la personne.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:group ref="LocationGroup"/>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="DeathDate" type="xsd:date" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de décès d'une personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="DeathPlace" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Lieu de décès d'une personne.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                    <xsd:group ref="LocationGroup"/>
+                </xsd:complexType>
+            </xsd:element>
+            <xsd:element name="Nationality" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Nationalité d'une personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Identifier" type="NonEmptyTokenType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Dans le PersonGroup, Identifiant de type numéro matricule.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Entity description -->
+    <xsd:group name="EntityGroup">
+        <xsd:sequence>
+            <xsd:element name="Corpname" type="xsd:string">
+                <xsd:annotation>
+                    <xsd:documentation>Nom d'une entité.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Identifier" type="NonEmptyTokenType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de l'entité.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Agent description -->
+    <xsd:complexType name="AgentType">
+        <xsd:annotation>
+            <xsd:documentation>Informations décrivant une personne physique ou morale.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="PersonOrEntityGroup"/>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:group name="PersonOrEntityGroup">
+        <xsd:choice>
+            <xsd:group ref="PersonGroup"/>
+            <xsd:group ref="EntityGroup"/>
+        </xsd:choice>
+    </xsd:group>
+    <!-- Business description -->
+    <xsd:group name="BusinessGroup">
+        <xsd:annotation>
+            <xsd:documentation>Références : AGKRMS.Business</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="Function" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Fonction.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Activity" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Activité.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Position" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Intitulé du poste de travail occupé par la personne.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Role" type="TextType" minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                    <xsd:documentation>Droits avec lesquels un utilisateur a réalisé une opération, notamment dans une application.</xsd:documentation>
+                    <xsd:documentation>Références : moreq.role</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <!-- Location description -->
+    <xsd:group name="LocationGroup">
+        <xsd:annotation>
+            <xsd:documentation>Localisation.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:all>
+            <xsd:element name="Geogname" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Nom géographique.</xsd:documentation>
+                    <xsd:documentation>Références : ead.geogname</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Address" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Adresse.</xsd:documentation>
+                    <xsd:documentation>Références : ead.address</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="PostalCode" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Code postal.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="City" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Ville.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Region" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Région.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Country" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>En plus des balises Tag et Keyword, il est possible d'indexer les objets avec des éléments pré-définis : Pays.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:all>
+    </xsd:group>
+    <!-- GPS Description: shared with Descriptive and Technical -->
+    <xsd:group name="GpsGroup">
+        <xsd:sequence>
+            <xsd:element name="Gps" type="GpsType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Coordonnées gps complétées ou vérifiées par un utilisateur. Fait référence à des coordonnées traitées par un utilisateur et non à des coordonnées captées.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="GpsType">
+        <xsd:sequence>
+            <xsd:element name="GpsVersionID" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de la version du GPS.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsAltitude" type="xsd:integer" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Altitude de la position GPS.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsAltitudeRef" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>0 (niveau de la mer) / 1 (référence au niveau de la mer - valeur négative -).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsLatitude" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>N (Nord) /  S (Sud).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsLatitudeRef" type="xsd:string" minOccurs="0"/>
+            <xsd:element name="GpsLongitude" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Latitude de la position GPS.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsLongitudeRef" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>E (Est) / W (Ouest).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="GpsDateStamp" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Heure et Date de la position GPS.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+</xsd:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-technical.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-technical.xsd
new file mode 100644
index 00000000000..9e557ee06d1
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-technical.xsd
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0"
+    elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+    <xsd:include schemaLocation="seda-2.0-types.xsd"/>
+
+    <!--
+                *****************************
+                ***   Code List
+                *****************************
+ 
+        -->
+    <xsd:group name="TechnicalCodeListsGroup">
+        <xsd:annotation>
+            <xsd:documentation>Liste de codes à utiliser dans les métadonnées techniques.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:group ref="DigestAlgorithmCodeListGroup"/>
+            <xsd:group ref="MimeTypeCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="EncodingCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="FileFormatCodeListGroup"/>
+            <xsd:group ref="CompressionAlgorithmCodeListGroup" minOccurs="0"/>
+            <xsd:group ref="DataObjectVersionCodeListGroup" minOccurs="0"/>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- Identification of format code -->
+    <xsd:simpleType name="MimeTypeType">
+        <xsd:annotation>
+            <xsd:documentation>Code de type Mime.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+    <xsd:group name="MimeTypeCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="MimeTypeCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de code du type Mime.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="EncodingType">
+        <xsd:annotation>
+            <xsd:documentation>Encodage du fichier.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+    <xsd:group name="EncodingCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="EncodingCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de code d'encodage du fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="FileFormatType">
+        <xsd:annotation>
+            <xsd:documentation>Identification du format de fichier.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+    <xsd:group name="FileFormatCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="FileFormatCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de code d'identification du format.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="CompressionAlgorithmType">
+        <xsd:annotation>
+            <xsd:documentation>Algorithme de compression utilisée.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+    <xsd:group name="CompressionAlgorithmCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="CompressionAlgorithmCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Version de la liste de code de l'algorithme de compression.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    
+    <!-- Identification d'une version pour un même objet intellectuel  -->
+    <xsd:group name="DataObjectVersionCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="DataObjectVersionCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Liste de codes correspondant aux diverses versions d'un objet-données au sein d’un groupe d'objets-données (ex. original papier, conservation, diffusion, vignette, txt).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="VersionIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant utilisé pour référencer les versions (conservation, diffusion, thumbnail/vignette, raw/brut, txt, ...).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+
+    <!-- Paquet d'Objets-données -->
+    <xsd:group name="DataObjectVersionGroup">
+        <xsd:annotation>
+            <xsd:documentation>Groupe d’objets-données (numériques ou physiques), correspondant aux différentes versions d’un même objet intellectuellement unique. Chaque version peut être par exemple : original papier, version de conservation, version de diffusion, version vignette, version texte ascii…
+                Lorsqu'un objet-donnée fait partie d'un groupe, le référencement dans les ArchiveUnit ne peut se faire que via ce groupe (DataObjectGroupId).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:choice>
+                <xsd:element name="DataObjectGroupReferenceId" type="GroupRefIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à un Identifiant du groupe d'objets-données DataObjectVersionGroup.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="DataObjectGroupId" type="GroupIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Identifiant du groupe d'objets-données DataObjectVersionGroup (première et unique définition).</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>                
+            </xsd:choice>
+            <xsd:element name="DataObjectVersion" type="VersionIdType">
+                <xsd:annotation>
+                    <xsd:documentation>Version d’un objet-données (par exemple : original papier, conservation, diffusion, vignette, txt, …).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="MinimalDataObjectType" abstract="true">
+        <xsd:sequence>
+            <xsd:element name="Relationship" minOccurs="0" maxOccurs="unbounded"
+                type="RelationshipType">
+                <xsd:annotation>
+                    <xsd:documentation>Permet de spécifier un lien technique entre un objet-données et une signature.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:group ref="DataObjectVersionGroup" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="DataObjectIdType" use="required">
+            <xsd:annotation>
+                <xsd:documentation>Identifiant de l'objet-données associé.</xsd:documentation>
+            </xsd:annotation>
+        </xsd:attribute>
+    </xsd:complexType>
+
+    <!-- Objet de donnees numérique -->
+    <xsd:complexType name="BinaryDataObjectType">
+        <xsd:annotation>
+            <xsd:documentation>Objet-données numérique.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="MinimalDataObjectType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées techniques minimales : URI, Digest, Poids.</xsd:documentation>
+                </xsd:annotation>
+                <xsd:sequence>
+                    <xsd:choice>
+                        <xsd:element name="Attachment" type="BinaryObjectType">
+                            <xsd:annotation>
+                                <xsd:documentation>Objet-données (contenu binaire ou fichier joint).</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                        <xsd:element name="Uri" type="xsd:anyURI">
+                            <xsd:annotation>
+                                <xsd:documentation>L'URI spécifie où se trouve l'objet-données numérique. Peut correspondre à un chemin relatif.</xsd:documentation>
+                            </xsd:annotation>
+                        </xsd:element>
+                    </xsd:choice>
+                    <xsd:element name="MessageDigest" type="MessageDigestBinaryObjectType">
+                        <xsd:annotation>
+                            <xsd:documentation>Empreinte de l'objet-données.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Size" type="SizeInBytesType">
+                        <xsd:annotation>
+                            <xsd:documentation>Permet de spécifier la taille de l'objet-données en octet.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Compressed" minOccurs="0">
+                        <xsd:annotation>
+                            <xsd:documentation>Indique si l’objet-données est compressé et doit être décompressé.</xsd:documentation>
+                        </xsd:annotation>
+                        <xsd:complexType>
+                            <xsd:simpleContent>
+                                <xsd:extension base="xsd:boolean">
+                                    <xsd:attribute name="algorithm" type="CompressionAlgorithmType" use="required"/>
+                                    <xsd:attribute name="uncompressedSize" type="SizeInBytesType"
+                                        use="required"/>
+                                </xsd:extension>
+                            </xsd:simpleContent>
+                        </xsd:complexType>
+                    </xsd:element>
+                    <xsd:group ref="BinaryTechnicalDescriptionGroup">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnées techniques pour les objets-données numériques.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:group>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:group name="BinaryTechnicalDescriptionGroup">
+        <xsd:annotation>
+            <xsd:documentation>Métadonnées techniques pour les objets-données numériques.</xsd:documentation>
+            <xsd:documentation>Inspiré du schéma FITS.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="FormatIdentification" type="FormatIdentificationType">
+                <xsd:annotation>
+                    <xsd:documentation>Identification du format de l'objet-données.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="FileInfo" type="FileInfoType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Propriétés techniques génériques du fichier (nom d’origine, logiciel de création, système d’exploitation de création).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Metadata" type="CoreMetadataType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Propriétés techniques spécifiques du fichier en fonction de sa nature technique (texte, document, image, audio, vidéo, etc.).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="OtherMetadata" type="DescriptiveTechnicalMetadataType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Autres métadonnées techniques si celles définies précédemment ne suffisent pas.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+
+    <!-- FormatIdentification elements -->
+    <xsd:complexType name="FormatIdentificationType">
+        <xsd:sequence>
+            <xsd:element name="FormatLitteral" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Forme littérale du nom du format.</xsd:documentation>
+                    <xsd:documentation>Exemple : Microsoft Word Document.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="MimeType" type="MimeTypeType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Type Mime associé, potentiellement stable mais pas assez précis.</xsd:documentation>
+                    <xsd:documentation>Exemple : application/msword</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="FormatId" type="FileFormatType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Type spécifique du format tel que défini dans FormatIdCodeList.</xsd:documentation>
+                    <xsd:documentation>Exemple : (Pronom)fmt/40</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Encoding" type="EncodingType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Encodage du fichier tel que défini dans EncodingIdCodeList.</xsd:documentation>
+                    <xsd:documentation>Exemple : Utf-8</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!-- File info elements -->
+    <xsd:complexType name="FileInfoType">
+        <xsd:annotation>
+            <xsd:documentation>Informations sur le fichier lui-même (d'un point de vue technique).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="Filename" type="xsd:string">
+                <xsd:annotation>
+                    <xsd:documentation>Nom du fichier d'origine.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="CreatingApplicationName" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Nom de l'application utilisée pour créer le fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="CreatingApplicationVersion" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Version de l'application utilisée pour créer le fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="DateCreatedByApplication" type="xsd:dateTime" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de création du fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="CreatingOs" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Système d’exploitation utilisé pour créer le fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="CreatingOsVersion" type="xsd:string" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Version du système d'exploitation utilisé pour créer le fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="LastModified" type="xsd:dateTime" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Date de la dernière modification du fichier.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!-- Objet de donnees physique -->
+    <xsd:group name="PhysicalTechnicalDescriptionGroup">
+        <xsd:annotation>
+            <xsd:documentation>Objet-données physique.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:element name="PhysicalDimensions" type="DimensionsType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Dimensions d'un objet-données physique.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="OtherDimensionsAbstract" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:complexType name="PhysicalDataObjectType">
+        <xsd:complexContent>
+            <xsd:extension base="MinimalDataObjectType">
+                <xsd:sequence>
+                    <xsd:element name="PhysicalId" type="IdentifierType">
+                        <xsd:annotation>
+                            <xsd:documentation>Identifiant physique d’un objet-données physique, externe à celui-ci (ex. code-barres).</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:group ref="PhysicalTechnicalDescriptionGroup"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- Metadata types: inspired from various Library of Congress schema -->
+    <xsd:complexType name="CoreMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Métadonnées de base par type d'objet-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:choice>
+            <xsd:element name="Text" type="TextTechnicalMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données de type textuel.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Document" type="DocumentTechnicalMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données de type document.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Image" type="ImageTechnicalMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données de type image.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Audio" type="AudioTechnicalMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données de type audio.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="Video" type="VideoTechnicalMetadataType">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données de type vidéo.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element ref="OtherCoreTechnicalMetadataAbstract">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées pour un objet-données d’un autre type (base de données, 3D, programmes, formats propriétaires, etc.).</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:choice>
+    </xsd:complexType>
+
+    <!-- Physical description: inspired from AudioMD of Library of Congress and UNECE_MeasurementUnitCommonCode -->
+    <xsd:complexType name="DimensionsType">
+        <xsd:annotation>
+            <xsd:documentation>Permet d'exprimer les mesures de dimensions basiques.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="BaseDimensionsType">
+                <xsd:sequence>
+                    <xsd:element name="Width" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : largeur.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Height" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : hauteur.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Depth" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : profondeur.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Shape" type="xsd:string" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : forme.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Diameter" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : diamètre.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Length" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : longueur.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Thickness" type="MeasurementType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : épaisseur.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="Weight" type="MeasurementWeightType" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : poids.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                    <xsd:element name="NumberOfPage" type="xsd:int" minOccurs="0" maxOccurs="1">
+                        <xsd:annotation>
+                            <xsd:documentation>Métadonnée de dimension physique : nombre de pages.</xsd:documentation>
+                        </xsd:annotation>
+                    </xsd:element>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="BaseDimensionsType" abstract="true"/>
+    <xsd:complexType name="MeasurementType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:decimal">
+                <xsd:attribute name="unit" type="MeasurementUnitsType" use="required">
+                    <xsd:annotation>
+                        <xsd:documentation>Références : Voir UNECE_MeasurementUnitCommonCode_8.xsd</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:attribute>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    <xsd:simpleType name="MeasurementUnitsType">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="micrometre"/>
+            <xsd:enumeration value="4H"/>
+            <xsd:enumeration value="millimetre"/>
+            <xsd:enumeration value="MMT"/>
+            <xsd:enumeration value="centimetre"/>
+            <xsd:enumeration value="CMT"/>
+            <xsd:enumeration value="metre"/>
+            <xsd:enumeration value="inch"/>
+            <xsd:enumeration value="INH"/>
+            <xsd:enumeration value="foot"/>
+            <xsd:enumeration value="FOT"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:complexType name="MeasurementWeightType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:decimal">
+                <xsd:attribute name="unit" type="MeasurementWeightUnitsType" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    <xsd:simpleType name="MeasurementWeightUnitsType">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="microgram"/>
+            <xsd:enumeration value="MC"/>
+            <xsd:enumeration value="milligram"/>
+            <xsd:enumeration value="MGM"/>
+            <xsd:enumeration value="gram"/>
+            <xsd:enumeration value="GRM"/>
+            <xsd:enumeration value="kilogram"/>
+            <xsd:enumeration value="KGM"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+</xsd:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/seda-2.0-types.xsd b/src/app/external/exportSeda/resources/xsd/seda-2.0-types.xsd
new file mode 100644
index 00000000000..0e2a36bb77e
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/seda-2.0-types.xsd
@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+        targetNamespace="fr:gouv:culture:archivesdefrance:seda:v2.0"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xlink="http://www.w3.org/1999/xlink"
+        xmlns="fr:gouv:culture:archivesdefrance:seda:v2.0"
+        elementFormDefault="qualified"
+        attributeFormDefault="unqualified"
+        version="1.0">
+
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
+    <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+
+    <!--
+                *****************************
+                ***   Types de base
+                *****************************
+        -->
+    <!-- Code -->
+    <xsd:complexType name="CodeType">
+        <xsd:simpleContent>
+            <xsd:extension base="NonEmptyTokenType">
+                <xsd:attribute name="listID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="listAgencyID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="listAgencyName" type="xsd:string" use="optional"/>
+                <xsd:attribute name="listName" type="xsd:string" use="optional"/>
+                <xsd:attribute name="listVersionID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="name" type="xsd:string" use="optional"/>
+                <xsd:attribute name="languageID" type="xsd:language" use="optional"/>
+                <xsd:attribute name="listURI" type="xsd:anyURI" use="optional"/>
+                <xsd:attribute name="listSchemeURI" type="xsd:anyURI" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    
+    <!-- Texte -->
+    <xsd:complexType name="TextType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+                <xsd:attribute ref="xml:lang" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    
+    <!-- Identifiant -->
+    <xsd:complexType name="IdentifierType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:token">
+                <xsd:attribute name="schemeID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="schemeName" type="xsd:string" use="optional"/>
+                <xsd:attribute name="schemeAgencyID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="schemeAgencyName" type="xsd:string" use="optional"/>
+                <xsd:attribute name="schemeVersionID" type="xsd:token" use="optional"/>
+                <xsd:attribute name="schemeDataURI" type="xsd:anyURI" use="optional"/>
+                <xsd:attribute name="schemeURI" type="xsd:anyURI" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    
+    <!-- Type à spécifier -->
+    <xsd:attributeGroup name="OpenTypeAttributeGroup">
+        <xsd:attribute ref="xml:id" use="optional"/>
+        <xsd:attribute ref="xlink:href" use="optional"/>
+    </xsd:attributeGroup>
+    <xsd:complexType name="OpenType" abstract="true">
+        <xsd:sequence>
+            <xsd:any namespace="##other" processContents="lax" minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:attributeGroup ref="OpenTypeAttributeGroup"/>
+    </xsd:complexType> 
+
+    <xsd:simpleType name="NonEmptyTokenType">
+        <xsd:annotation>
+            <xsd:documentation>Elément ne pouvant être vide.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:token">
+            <xsd:minLength value="1"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    <!-- ID -->
+    <xsd:simpleType name="DataObjectIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant utilisé pour les objets-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:ID"/>
+    </xsd:simpleType>
+    <xsd:simpleType name="DataObjectRefIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant servant aux relations des objets-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:IDREF"/>
+    </xsd:simpleType>
+    <xsd:simpleType name="GroupIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant utilisé pour les groupes d'objets-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:union>
+            <xsd:simpleType>
+                <xsd:restriction base="xsd:ID"/>
+            </xsd:simpleType>
+        </xsd:union>
+    </xsd:simpleType>
+    <xsd:simpleType name="GroupRefIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant utilisé pour référencer les groupes d'objets-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:IDREF"/>
+    </xsd:simpleType>
+    <xsd:complexType name="DataObjectRefType">
+        <xsd:annotation>
+            <xsd:documentation>Référence à un objet-données ou à un groupe d'objets-données.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:choice>
+                <xsd:element name="DataObjectReferenceId" type="DataObjectRefIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à un objet-données listé dans les métadonnées de transport.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+                <xsd:element name="DataObjectGroupReferenceId" type="GroupRefIdType">
+                    <xsd:annotation>
+                        <xsd:documentation>Référence à un groupe d'objets-données listé dans les métadonnées de transport.</xsd:documentation>
+                    </xsd:annotation>
+                </xsd:element>
+            </xsd:choice>
+        </xsd:sequence>
+        <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+    </xsd:complexType>
+    
+    <!-- ID of an ArchiveUnit -->
+    <xsd:simpleType name="ArchiveUnitIdType">
+        <xsd:annotation>
+            <xsd:documentation>Identifiant utilisé pour les unités d'archives.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:ID"/>
+    </xsd:simpleType>
+    <xsd:simpleType name="ArchiveUnitRefIdType">
+        <xsd:annotation>
+            <xsd:documentation>Référence aux identifiants utilisés pour les unités d'archives.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:IDREF"/>
+    </xsd:simpleType>
+    
+    <xsd:simpleType name="SizeInBytesType">
+        <xsd:annotation>
+            <xsd:documentation>Poids des objets-données binaires en bytes.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="xsd:positiveInteger"/>
+    </xsd:simpleType>
+
+    <!-- Binary encoding -->
+    <xsd:simpleType name="BinaryType">
+        <xsd:annotation>
+            <xsd:documentation>Représentation binaire : utilisation possible de base64 ou d'hexadécimal.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:union memberTypes="xsd:base64Binary xsd:hexBinary"/>
+    </xsd:simpleType>
+    
+    <!-- Digest -->
+    <xsd:group name="DigestAlgorithmCodeListGroup">
+        <xsd:sequence>
+            <xsd:element name="MessageDigestAlgorithmCodeListVersion" type="CodeType">
+                <xsd:annotation>
+                    <xsd:documentation>Liste de l'algorithme de hachage utilisé dans le message.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:group>
+    <xsd:simpleType name="DigestAlgorithmCodeType">
+        <xsd:annotation>
+            <xsd:documentation>Algorithme de hachage spécifié dans DigestAlgorithmCodeList.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:restriction base="NonEmptyTokenType"/>
+    </xsd:simpleType>
+    <xsd:complexType name="MessageDigestBinaryObjectType">
+        <xsd:simpleContent>
+            <xsd:extension base="BinaryType">
+                <xsd:attribute name="algorithm" type="DigestAlgorithmCodeType" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+    
+    <!--
+                *****************************
+                ***   Types métier
+                *****************************
+ 
+        -->
+    
+    <!-- Contenu de données binaire -->
+    <xsd:complexType name="BinaryObjectType"> 
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:base64Binary">
+                <xsd:attribute name="filename" type="xsd:string" use="optional"/>
+                <xsd:attribute name="uri" type="xsd:anyURI" use="optional"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType> 
+    
+    <!-- Données liées -->
+    <xsd:complexType name="RelationshipType">
+        <xsd:attribute name="target" type="xsd:IDREF" use="required"/>
+        <xsd:attribute name="type" type="NonEmptyTokenType" use="required"/>
+    </xsd:complexType>
+    
+    <!-- Organisation -->
+    <xsd:complexType name="OrganizationType">
+        <xsd:sequence>
+            <xsd:element name="Identifier" type="IdentifierType">
+                <xsd:annotation>
+                    <xsd:documentation>Identifiant de l'organisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+            <xsd:element name="OrganizationDescriptiveMetadata" type="OrganizationDescriptiveMetadataType" minOccurs="0">
+                <xsd:annotation>
+                    <xsd:documentation>Métadonnées de description de l'organisation.</xsd:documentation>
+                </xsd:annotation>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+    
+    <!--
+                ***************************** 
+                ***   Objets à redéfinir
+                *****************************
+                La redéfinition permet de fixer le nom de la balise tout en permettant la définition du type ultérieurement
+        -->
+    
+    <!-- Métadonnées descriptives pour une organisation -->
+    <xsd:complexType name="OrganizationDescriptiveMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées de description des organisations.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+        
+    <!-- Signature in Main message block -->
+    <xsd:complexType name="SignatureType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées dsur la signature.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <!-- In CoreMetadataType from seda-2.0-technical.xsd: Technical Metadata Content -->
+    <xsd:complexType name="TextTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour les objets-données de type texte(XML, JSON, CSV, ...).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="DocumentTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour les objets-données de type document (Word, PDF, XLS, LibreOffice, ...).</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="ImageTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour les objets-données de type image.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="AudioTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour les objets-données de type audio.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="VideoTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour les objets-données de type video.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:complexType name="DescriptiveTechnicalMetadataType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques et/ou descriptives définies dans un schéma par un service producteur ou versant mais n'étant pas présentes dans les métadonnées de base.</xsd:documentation>
+        </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="OpenType"/>
+        </xsd:complexContent>
+    </xsd:complexType>
+    
+    <!--
+                ******************************************* 
+                ***   Objets à spécifier par substitution
+                *******************************************
+                La substitution permet de ne pas fixer le nom de la balise, d'en autoriser plusieurs et de laisser l'implémentation choisir en fonction de ses besoins.
+        -->
+    <!-- In ObjectGroup from seda-2-0-ontology.xsd: Extra Descriptive Metadata Content -->
+    <xsd:element name="ObjectGroupExtenstionAbstract" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>Permet d'étendre ObjectGroup avec d'autres métadonnées descriptives.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+    <!-- In PhysicalTechnicalDescriptionGroup from seda-2.0-technical.xsd: extra dimension techncal description for PhysicalDataObject -->
+    <xsd:element name="OtherDimensionsAbstract" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>Permet d'étendre &lt;OtherDimensions&gt; avec d'autres métadonnées de description des objets-données physiques.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+    <!-- In CoreMetadataType from seda-2.0-technical.xsd: extra Core TechnicalMetadata (Database, 3D, plan, ...) -->
+    <xsd:element name="OtherCoreTechnicalMetadataAbstract" abstract="true" type="OpenType">
+        <xsd:annotation>
+            <xsd:documentation>Contient toutes les métadonnées techniques de base pour d'autres types.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+    <!-- In ArchiveUnitType from seda-2.0-descriptive.xsd: Abstract for ArchiveUnit reference from within EAS -->
+    <xsd:element name="ArchiveUnitReferenceAbstract" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>Contient les requêtes nécessaires pour trouver un ArchiveUnit et pointer sur lui dans un prochain ArchiveUnit.
+                Permet de référencer un noeud déjà existant dans un arbre à partir d'un transfert précédent.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+    <!-- In ManagementGroup from seda-2.0-management.xsd: for Management extension -->
+    <xsd:element name="OtherManagementAbstract" abstract="true">
+        <xsd:annotation>
+            <xsd:documentation>Utilisé par exemple pour manipuler un ArchiveUnit déjà existant dans le système d'archivage électronique.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+    <!-- In CodeListVersionsType from seda-2.0-main.xsd: If needed, extra CodeList could be added -->
+    <xsd:element name="OtherCodeListAbstract" abstract="true" type="CodeType">
+        <xsd:annotation>
+            <xsd:documentation>Permet d'ajouter de nouvelles listes de codes si l'ajout d'autres métadonnées l'impose.</xsd:documentation>
+        </xsd:annotation>
+    </xsd:element>
+    
+</xsd:schema>
+ 
diff --git a/src/app/external/exportSeda/resources/xsd/xlink.xsd b/src/app/external/exportSeda/resources/xsd/xlink.xsd
new file mode 100644
index 00000000000..6f4d0a274d8
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/xlink.xsd
@@ -0,0 +1,270 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink">
+ 
+ <xs:annotation>
+  <xs:documentation>This schema document provides attribute declarations and
+attribute group, complex type and simple type definitions which can be used in
+the construction of user schemas to define the structure of particular linking
+constructs, e.g.
+<![CDATA[
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:xl="http://www.w3.org/1999/xlink">
+
+ <xs:import namespace="http://www.w3.org/1999/xlink"
+            location="http://www.w3.org/1999/xlink.xsd">
+
+ <xs:element name="mySimple">
+  <xs:complexType>
+   ...
+   <xs:attributeGroup ref="xl:simpleAttrs"/>
+   ...
+  </xs:complexType>
+ </xs:element>
+ ...
+</xs:schema>]]></xs:documentation>
+ </xs:annotation>
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
+
+ <xs:attribute name="type" type="xlink:typeType"/>
+
+ <xs:simpleType name="typeType">
+  <xs:restriction base="xs:token">
+   <xs:enumeration value="simple"/>
+   <xs:enumeration value="extended"/>
+   <xs:enumeration value="title"/>
+   <xs:enumeration value="resource"/>
+   <xs:enumeration value="locator"/>
+   <xs:enumeration value="arc"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="href" type="xlink:hrefType"/>
+
+ <xs:simpleType name="hrefType">
+  <xs:restriction base="xs:anyURI"/>
+ </xs:simpleType>
+
+ <xs:attribute name="role" type="xlink:roleType"/>
+
+ <xs:simpleType name="roleType">
+  <xs:restriction base="xs:anyURI">
+   <xs:minLength value="1"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="arcrole" type="xlink:arcroleType"/>
+
+ <xs:simpleType name="arcroleType">
+  <xs:restriction base="xs:anyURI">
+   <xs:minLength value="1"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="title" type="xlink:titleAttrType"/>
+
+ <xs:simpleType name="titleAttrType">
+  <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+
+ <xs:attribute name="show" type="xlink:showType"/>
+
+ <xs:simpleType name="showType">
+  <xs:restriction base="xs:token">
+   <xs:enumeration value="new"/>
+   <xs:enumeration value="replace"/>
+   <xs:enumeration value="embed"/>
+   <xs:enumeration value="other"/>
+   <xs:enumeration value="none"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="actuate" type="xlink:actuateType"/>
+
+ <xs:simpleType name="actuateType">
+  <xs:restriction base="xs:token">
+   <xs:enumeration value="onLoad"/>
+   <xs:enumeration value="onRequest"/>
+   <xs:enumeration value="other"/>
+   <xs:enumeration value="none"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:attribute name="label" type="xlink:labelType"/>
+
+ <xs:simpleType name="labelType">
+  <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:attribute name="from" type="xlink:fromType"/>
+
+ <xs:simpleType name="fromType">
+  <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:attribute name="to" type="xlink:toType"/>
+
+ <xs:simpleType name="toType">
+  <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:attributeGroup name="simpleAttrs">
+  <xs:attribute ref="xlink:type" fixed="simple"/>
+  <xs:attribute ref="xlink:href"/>
+  <xs:attribute ref="xlink:role"/>
+  <xs:attribute ref="xlink:arcrole"/>
+  <xs:attribute ref="xlink:title"/>
+  <xs:attribute ref="xlink:show"/>
+  <xs:attribute ref="xlink:actuate"/>
+ </xs:attributeGroup>
+
+ <xs:group name="simpleModel">
+  <xs:sequence>
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:complexType mixed="true" name="simple">
+  <xs:annotation>
+   <xs:documentation>
+    Intended for use as the type of user-declared elements to make them
+    simple links.
+   </xs:documentation>
+  </xs:annotation>
+  <xs:group ref="xlink:simpleModel"/>
+  <xs:attributeGroup ref="xlink:simpleAttrs"/>
+ </xs:complexType>
+
+ <xs:attributeGroup name="extendedAttrs">
+  <xs:attribute ref="xlink:type" fixed="extended" use="required"/>
+  <xs:attribute ref="xlink:role"/>
+  <xs:attribute ref="xlink:title"/>
+ </xs:attributeGroup>
+
+ <xs:group name="extendedModel">
+   <xs:choice>
+    <xs:element ref="xlink:title"/>
+    <xs:element ref="xlink:resource"/>
+    <xs:element ref="xlink:locator"/>
+    <xs:element ref="xlink:arc"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:complexType name="extended">
+  <xs:annotation>
+   <xs:documentation>
+    Intended for use as the type of user-declared elements to make them
+    extended links.
+    Note that the elements referenced in the content model are all abstract.
+    The intention is that by simply declaring elements with these as their
+    substitutionGroup, all the right things will happen.
+   </xs:documentation>
+  </xs:annotation>
+  <xs:group ref="xlink:extendedModel" minOccurs="0" maxOccurs="unbounded"/>
+  <xs:attributeGroup ref="xlink:extendedAttrs"/>
+ </xs:complexType>
+
+ <xs:element name="title" type="xlink:titleEltType" abstract="true"/>
+
+ <xs:attributeGroup name="titleAttrs">
+  <xs:attribute ref="xlink:type" fixed="title" use="required"/>
+  <xs:attribute ref="xml:lang">
+   <xs:annotation>
+    <xs:documentation>
+     xml:lang is not required, but provides much of the
+     motivation for title elements in addition to attributes, and so
+     is provided here for convenience.
+    </xs:documentation>
+   </xs:annotation>
+  </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:group name="titleModel">
+  <xs:sequence>
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:complexType mixed="true" name="titleEltType">
+  <xs:group ref="xlink:titleModel"/>
+  <xs:attributeGroup ref="xlink:titleAttrs"/>
+ </xs:complexType>
+
+ <xs:element name="resource" type="xlink:resourceType" abstract="true"/>
+
+ <xs:attributeGroup name="resourceAttrs">
+  <xs:attribute ref="xlink:type" fixed="resource" use="required"/>
+  <xs:attribute ref="xlink:role"/>
+  <xs:attribute ref="xlink:title"/>
+  <xs:attribute ref="xlink:label"/>
+ </xs:attributeGroup>
+
+ <xs:group name="resourceModel">
+  <xs:sequence>
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:complexType mixed="true" name="resourceType">
+  <xs:group ref="xlink:resourceModel"/>
+  <xs:attributeGroup ref="xlink:resourceAttrs"/>
+ </xs:complexType>
+
+ <xs:element name="locator" type="xlink:locatorType" abstract="true"/>
+
+ <xs:attributeGroup name="locatorAttrs">
+  <xs:attribute ref="xlink:type" fixed="locator" use="required"/>
+  <xs:attribute ref="xlink:href" use="required"/>
+  <xs:attribute ref="xlink:role"/>
+  <xs:attribute ref="xlink:title"/>
+  <xs:attribute ref="xlink:label">
+   <xs:annotation>
+    <xs:documentation>
+     label is not required, but locators have no particular
+     XLink function if they are not labeled.
+    </xs:documentation>
+   </xs:annotation>
+  </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:group name="locatorModel">
+  <xs:sequence>
+   <xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:complexType name="locatorType">
+  <xs:group ref="xlink:locatorModel"/>
+  <xs:attributeGroup ref="xlink:locatorAttrs"/>
+ </xs:complexType>
+
+ <xs:element name="arc" type="xlink:arcType" abstract="true"/>
+
+ <xs:attributeGroup name="arcAttrs">
+  <xs:attribute ref="xlink:type" fixed="arc" use="required"/>
+  <xs:attribute ref="xlink:arcrole"/>
+  <xs:attribute ref="xlink:title"/>
+  <xs:attribute ref="xlink:show"/>
+  <xs:attribute ref="xlink:actuate"/>
+  <xs:attribute ref="xlink:from"/>
+  <xs:attribute ref="xlink:to">
+   <xs:annotation>
+    <xs:documentation>
+     from and to have default behavior when values are missing
+    </xs:documentation>
+   </xs:annotation>
+  </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:group name="arcModel">
+  <xs:sequence>
+   <xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:complexType name="arcType">
+  <xs:group ref="xlink:arcModel"/>
+  <xs:attributeGroup ref="xlink:arcAttrs"/>
+ </xs:complexType>
+
+</xs:schema>
diff --git a/src/app/external/exportSeda/resources/xsd/xml.xsd b/src/app/external/exportSeda/resources/xsd/xml.xsd
new file mode 100644
index 00000000000..85bea7906ab
--- /dev/null
+++ b/src/app/external/exportSeda/resources/xsd/xml.xsd
@@ -0,0 +1,287 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns   ="http://www.w3.org/1999/xhtml"
+  xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+    <h1>About the XML namespace</h1>
+
+    <div class="bodytext">
+     <p>
+      This schema document describes the XML namespace, in a form
+      suitable for import by other schema documents.
+     </p>
+     <p>
+      See <a href="http://www.w3.org/XML/1998/namespace.html">
+      http://www.w3.org/XML/1998/namespace.html</a> and
+      <a href="http://www.w3.org/TR/REC-xml">
+      http://www.w3.org/TR/REC-xml</a> for information 
+      about this namespace.
+     </p>
+     <p>
+      Note that local names in this namespace are intended to be
+      defined only by the World Wide Web Consortium or its subgroups.
+      The names currently defined in this namespace are listed below.
+      They should not be used with conflicting semantics by any Working
+      Group, specification, or document instance.
+     </p>
+     <p>   
+      See further below in this document for more information about <a
+      href="#usage">how to refer to this schema document from your own
+      XSD schema documents</a> and about <a href="#nsversioning">the
+      namespace-versioning policy governing this schema document</a>.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>lang (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       is a language code for the natural language of the content of
+       any element; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML specification.</p>
+     
+    </div>
+    <div>
+     <h4>Notes</h4>
+     <p>
+      Attempting to install the relevant ISO 2- and 3-letter
+      codes as the enumerated possible values is probably never
+      going to be a realistic possibility.  
+     </p>
+     <p>
+      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
+       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+      and the IANA language subtag registry at
+      <a href="http://www.iana.org/assignments/language-subtag-registry">
+       http://www.iana.org/assignments/language-subtag-registry</a>
+      for further information.
+     </p>
+     <p>
+      The union allows for the 'un-declaration' of xml:lang with
+      the empty string.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>    
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>space (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose
+       value is a keyword indicating what whitespace processing
+       discipline is intended for the content of the element; its
+       value is inherited.  This name is reserved by virtue of its
+       definition in the XML specification.</p>
+     
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+ 
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>base (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       provides a URI to be used as the base for interpreting any
+       relative URIs in the scope of the element on which it
+       appears; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML Base specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+ 
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>id (as an attribute name)</h3> 
+      <p>
+       denotes an attribute whose value
+       should be interpreted as if declared to be of type ID.
+       This name is reserved by virtue of its definition in the
+       xml:id specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+   
+    <h3>Father (in any context at all)</h3> 
+
+    <div class="bodytext">
+     <p>
+      denotes Jon Bosak, the chair of 
+      the original XML Working Group.  This name is reserved by 
+      the following decision of the W3C XML Plenary and 
+      XML Coordination groups:
+     </p>
+     <blockquote>
+       <p>
+	In appreciation for his vision, leadership and
+	dedication the W3C XML Plenary on this 10th day of
+	February, 2000, reserves for Jon Bosak in perpetuity
+	the XML name "xml:Father".
+       </p>
+     </blockquote>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div xml:id="usage" id="usage">
+    <h2><a name="usage">About this schema document</a></h2>
+
+    <div class="bodytext">
+     <p>
+      This schema defines attributes and an attribute group suitable
+      for use by schemas wishing to allow <code>xml:base</code>,
+      <code>xml:lang</code>, <code>xml:space</code> or
+      <code>xml:id</code> attributes on elements they define.
+     </p>
+     <p>
+      To enable this, such a schema must import this schema for
+      the XML namespace, e.g. as follows:
+     </p>
+     <pre>
+          &lt;schema . . .>
+           . . .
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     </pre>
+     <p>
+      or
+     </p>
+     <pre>
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     </pre>
+     <p>
+      Subsequently, qualified reference to any of the attributes or the
+      group defined below will have the desired effect, e.g.
+     </p>
+     <pre>
+          &lt;type . . .>
+           . . .
+           &lt;attributeGroup ref="xml:specialAttrs"/>
+     </pre>
+     <p>
+      will define a type which will schema-validate an instance element
+      with any of those attributes.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div id="nsversioning" xml:id="nsversioning">
+    <h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
+    <div class="bodytext">
+     <p>
+      In keeping with the XML Schema WG's standard versioning
+      policy, this schema document will persist at
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a>.
+     </p>
+     <p>
+      At the date of issue it can also be found at
+      <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd</a>.
+     </p>
+     <p>
+      The schema document at that URI may however change in the future,
+      in order to remain compatible with the latest version of XML
+      Schema itself, or with the XML namespace itself.  In other words,
+      if the XML Schema or XML namespaces change, the version of this
+      document at <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd 
+      </a> 
+      will change accordingly; the version at 
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd 
+      </a> 
+      will not change.
+     </p>
+     <p>
+      Previous dated (and unchanging) versions of this schema 
+      document are at:
+     </p>
+     <ul>
+      <li><a href="http://www.w3.org/2009/01/xml.xsd">
+	http://www.w3.org/2009/01/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2007/08/xml.xsd">
+	http://www.w3.org/2007/08/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2004/10/xml.xsd">
+	http://www.w3.org/2004/10/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2001/03/xml.xsd">
+	http://www.w3.org/2001/03/xml.xsd</a></li>
+     </ul>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
+
-- 
GitLab