class ArchiveUnitMapper {

    public ArchiveUnitType map(ArchiveUnitModel model) throws DatatypeConfigurationException {

        ArchiveUnitType archiveUnitType = new ArchiveUnitType();
        archiveUnitType.setId(model.getId());

        if (model.getArchiveUnitProfile() != null) {
            IdentifierType identifierType = new IdentifierType();
            identifierType.setValue(model.getArchiveUnitProfile());
            archiveUnitType.setArchiveUnitProfile(identifierType);
        }

        archiveUnitType.setContent(descriptiveMetadataMapper.map(model.getDescriptiveMetadataModel(), model.getHistory()));

        archiveUnitType.setManagement(managementMapper.map(model.getManagement()));

        return archiveUnitType;
    }

    public  ArchiveUnitMapper();

}