<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
  ~ Copyright (c) 2010-2017 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:tns="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" elementFormDefault="qualified" jaxb:extensionBindingPrefixes="xjc" jaxb:version="3.0" targetNamespace="http://prism.evolveum.com/xml/ns/public/annotation-3">

    <xsd:annotation>
        <xsd:documentation>
            Common Prism annotations used in various XSD schemas.

            Version: 4.0
            Default prefix: a
        </xsd:documentation>
        <xsd:appinfo>
            <a:defaultPrefix>a</a:defaultPrefix>
        </xsd:appinfo>
    </xsd:annotation>

    <xsd:element name="defaultPrefix">
        <xsd:annotation>
            <xsd:documentation>
                Defines constant prefix, which should be used for namespace defined in XSD schema
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="container">
        <xsd:annotation>
            <xsd:documentation>
                Item marker annotation: Container marker. This annotation marks complex types that are considered prism containers.

                Every first-level element in a container is prism item (property, another container or reference) even if
                it has no extra annotation.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="object">
        <xsd:annotation>
            <xsd:documentation>
                Item marker annotation: Object marker. This annotation marks complex types that are considered prism objects.
                Note: prism object are also containers.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="type" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                Type override annotation.
                TODO
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="displayName" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: item display name. The content of this annotation specifies a
                human-readable string that describes the type.
                E.g. "User" may be a good display name for UserType.
                It may also contain key to the catalog file.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="displayOrder" type="xsd:int">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: display order. The content of this annotation specifies
                an order in which the item should be displayed relative to other items
                at the same level. The items will be displayed by sorting them by the
                values of displayOrder annotation (ascending). Items that do not have
                any displayOrder annotation will be displayed last. The ordering of
                values with the same displayOrder is undefined and it may be arbitrary.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="help" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: help text. The help text is usually displayed as a tooltip
                or when a special icon is clicked.
                It may also contain key to the catalog file.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="access" type="tns:AccessAnnotationType">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: access restrictions. This annotation specifies the allowed
                operations for an item. If no access annotation is present then all
                operations are allowed.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:simpleType name="AccessAnnotationType">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: access restrictions. This annotation specifies the allowed
                operations for an item. If no access annotation is present then all
                operations are allowed.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="read"/>
            <xsd:enumeration value="update"/>
            <xsd:enumeration value="create"/>
            <xsd:enumeration value="none">
                <xsd:annotation>
                    <xsd:documentation>
                        Means "no access". Cannot be combined with other values.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <tns:since>4.9</tns:since>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="indexed" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Property marker annotation: indexed property. Property that has this
                annotation should be indexed in the data store.
                WARNING: Presence of this annotation may impose some restriction on the
                property, usually a length restriction. E.g. database systems usually
                restrict the length of a datatype that can be efficiently indexed.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="searchable" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Item marker annotation: searchable item. Marks item and its value as available for search.
                WARNING: Item may not be searchable in all contexts, primary use is to provide checks and additional hints
                during filter parsing.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="indexOnly" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Property marker annotation: index-only property. Property that has this
                annotation should be indexed in the data store but not stored in "full" object
                representation. Its retrieval usually requires an explicit INCLUDE option.
                This annotation implies indexed=true.
                WARNING: Presence of this annotation may impose some restriction on the
                property, usually a length restriction. E.g. database systems usually
                restrict the length of a datatype that can be efficiently indexed.

                BEWARE: EXPERIMENTAL. Almost no support of this for regular items
                (only shadow attributes, as per MID-5558).
            </xsd:documentation>
            <xsd:appinfo>
                <a:since>4.0</a:since>
                <a:experimental>true</a:experimental>
            </xsd:appinfo>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="displayHint" type="tns:DisplayHintType">
        <xsd:annotation>
            <xsd:documentation>
                Enumeration annotation that specifies how the item should be displayed.

                It is a replacement for the old "emphasized" annotation.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:simpleType name="DisplayHintType">
        <xsd:annotation>
            <xsd:documentation>
                Display hints for an item.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="hidden">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="HIDDEN"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="regular">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="REGULAR"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="emphasized">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EMPHASIZED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="collapsed">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="COLLAPSED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="expanded">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EXPANDED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="index" type="tns:IndexType">
        <xsd:annotation>
            <xsd:documentation>
                Item annotation: Specifies type of index that is maintained for this
                item. The data store maintains this type of index for the item.
                This annotation may appear several times (maxOccurs=unbounded).
                This annotation implies indexed=true.
                WARNING: Presence of this annotation may impose some restriction on the
                property, usually a length restriction. E.g. database systems usually
                restrict the length of a datatype that can be efficiently indexed.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:simpleType name="IndexType">
        <xsd:annotation>
            <xsd:documentation>
                Type of index maintained by the data store.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="equality">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EQUALITY"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="substring">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="SUBSTRING"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="presence">
                <xsd:annotation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="PRESENCE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:element name="ignore" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Item marker annotation: ignored item. Item that has this annotation
                should be ignored by any processing. The ignored item is still part
                of the schema. Item instances may appear in the serialized data formats
                (e.g. XML) or data store and the parser should not raise an error if
                it encounters them. But any high-level processing code should ignore
                presence of this item. E.g. it should not be displayed to the user, should
                not be present in transformed data structures, etc.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="processing" type="tns:ItemProcessingType">
        <xsd:annotation>
            <xsd:documentation>
                Specifies the "depth" of item processing.
                In midPoint 3.8 this is only supported by the user interface
                (presentation layer) and only as an experimental feature.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:simpleType name="ItemProcessingType">
        <xsd:annotation>
            <xsd:documentation>
                Specifies the "depth" of item processing.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="ignore">
                <xsd:annotation>
                    <xsd:documentation>
                        Item is ignored. No processing is done at all.
                        The item will behave in the same way as it is does not
                        exists at all.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="IGNORE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="minimal">
                <xsd:annotation>
                    <xsd:documentation>
                        Only very minimal item processing is done. This usually means
                        that basic data structures about the item is maintained.
                        The item values may be logged. But all automatic processing,
                        presentation, transformation or any similar processing is
                        skipped. This type of processing is designed to support
                        item processing by custom code. The underlying data structures
                        will be present and they can be manipulated by custom code.
                        But any built-in automatic processing will be skipped.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="MINIMAL"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="auto">
                <xsd:annotation>
                    <xsd:documentation>
                        All usual processing of the item is applied. Or automated presentation,
                        transformation or any other processing will take place.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="AUTO"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="operational" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks operational property. Operational properties are auxiliary data
                (or meta-data) that are usually not modifiable by the end user. They are
                generated and maintained by the system. Operational properties are also
                not usually displayed unless it is explicitly requested.

                The example of operation properties are modification timestamps, create timestamps,
                user that made the last change, etc.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="optionalCleanup" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks item that could be ignored by SCM tools (e.g. Git), or removed before commit.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="composite" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks composite reference. Composite references do not refer to the target
                object by OID but rather contain the entire target object forming a composition.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="embeddedObject">
        <xsd:annotation>
            <xsd:documentation>
                To be used on an item definition: marks the item as "embedded object", i.e. full object stored
                in a PrismContainer.

                The difference to "composite" is that the latter one is applicable only to object references.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="deprecated" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks deprecated parts of the schema.
                Deprecated parts are supposed to work, but their use is discouraged.
                Deprecated functionality may be removed in any future release.
                If there's a decision to remove deprecated part, it's firstly marked as "removed".
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="removed" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks removed parts of the schema.
                Removed parts will not work, code related to such configuration and data structures was removed.
                Parts marked removed are present in the schema to simplify upgrade.
                Parts marked removed will be removed from schema in LTS comming after LTS that has such part marked "removed".
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="experimental" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks experimental functionality.
                Experimental functionality is not stable and it may be changed in any
                future release without any warning. Use at your own risk.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="elaborate" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks elaborate items.
                Elaborate items are complicated data structure that may deviate from
                normal principles of the system. For example elaborate items may not
                be supported in user interface and may only be manageable by raw edits
                or a special-purpose tools. Elaborate items may be not fully supported
                by authorizations, schema tools and so on.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="emphasized" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                 Set true for definitions that are more important than others and that should be emphasized
                 during presentation. E.g. the emphasized definitions will always be displayed in the user
                 interfaces (even if they are empty), they will always be included in the dumps, etc.

                 REMOVED: Use display=emphasized instead.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="expensive" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks an expensive item. Expensive items are not returned from some operations
                by default. They have to be explicitly requested.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="relational" type="xsd:boolean">
        <xsd:annotation>
            <xsd:documentation>
                Marks a container that contains relational data. The relational container
                provides data that are normally stored in a simple relational table.
                The relational container must only contain primitive items (properties or references, not containers).
                It is expected that relational container will have many values.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="extension" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                Complex type annotation. Complex type that contains this annotation
                defines the content of the 'extension' item of data type specified by the
                content of this annotation. E.g. in the content of this annotation is
                c:UserType then the complex type that has this annotation defines the
                structure of 'extension' element of UserType objects.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="objectReference">
        <xsd:annotation>
            <xsd:documentation>
                Item marker annotation: object reference. This annotation specifies that
                an element or data type is object reference (PrismReference).
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="objectReferenceTargetType" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                Object reference annotation: reference target type. Content of this
                annotation specifies the object type that the reference points to.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="maxOccurs" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Same as normal maxOccurs XSD attribute, but can also be used
                with top-level elements.
                It may contain decimal string representation of a non-negative integer value or
                a string 'unbounded'.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:attribute name="maxOccurs" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Same as normal maxOccurs XSD attribute, but can also be used
                with dynamic elements similarly to xsi:type.
                It may contain decimal string representation of a non-negative integer value or
                a string 'unbounded'.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:attribute>

    <xsd:element name="since" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Version of data model in which was the item introduced.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="deprecatedSince" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Version of data model in which was the item marked as deprecated.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="removedSince" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Version of data model in which was the item marked as removed.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="plannedRemoval" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Version of data model in which the item is likely to be removed.
                This annotation is used for deprecated item to indicate imminent incompatibility in future versions of data model.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="plannedChange" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Version of data model in which the item is likely to be changed in a non-compatible way.
                This annotation is used for items that will be retained in future versions, but their definition is likely to change
                in a non-compatible way. It may also be used for major change in meaning or behavior of the item.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="label" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Displayable label of enumeration item.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="matchingRule" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                Matching rules are algorithms that specify
                 how to compare, normalize and/or order the values. E.g. there are matching
                rules for case insensitive string comparison, for LDAP DNs, etc.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="valueEnumerationRef" type="tns:ObjectReferenceType">
        <xsd:annotation>
            <xsd:documentation>
                Reference to an object that directly or indirectly represents possible values for
                this item. We do not define here what exactly the object has to be. It can be a lookup
                table, script that dynamically produces the values or anything similar.
                The object must produce the values of the correct type for this item otherwise an
                error occurs.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="ObjectReferenceType">
        <xsd:annotation>
            <xsd:documentation>
                <p>
                    Reference to an object. It contains OID of the object that it
                    refers to.
                    This is simplified version of the "real" object reference used
                    in the main schemas. This has to be a duplicate to avoid circular
                    dependencies.
                </p>
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="oid" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                    <p>
                        Target of the reference.
                    </p>
                    <p>
                        Optional only during imports. The objects stored in the repository must have the OID
                        value filled in.
                    </p>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="type" type="xsd:QName" use="optional">
            <xsd:annotation>
                <xsd:documentation>
                    <p>
                        Type of the reference target object.
                    </p>
                    <p>
                        It has to be provided unless the schema explicitly defines
                        a non-polymorphic type for the reference target type.
                    </p>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>

    <xsd:element name="defaultItemTypeName" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Type name for items that are not explicitly defined in the complex type definition to which this annotation
                applies. Currently, only statically typed container and reference complex type definitions are supported here.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="defaultReferenceTargetTypeName" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                When defaultItemTypeName points to a reference type, this annotation can provide the default target type name
                for such a reference.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="defaultNamespace" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                When resolving unqualified elements, what should be the default namespace to look into at first.
                Applies to a container, currently at the topmost level.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="ignoredNamespace" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                When resolving unqualified elements, what namespace(s) should be ignored.
                String entered here is interpreted as a namespace prefix.
                Applies to a container, currently at the topmost level.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="heterogeneousListItem" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                This substitutable element can be used in "heterogeneous list" items, i.e. items that can have
                several values with different types. (All having a common declared supertype.) This annotation is necessary
                to minimize "guesswork" that XML parser has to do when processing substitutable elements - in order to lower
                the risk of accidentally merging two unrelated subsequent elements into one.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="instantiationOrder" type="xsd:int">
        <xsd:annotation>
            <xsd:documentation>
                When parsing a field that is known to contain an abstract data type (e.g. LocalizableMessageType)
                and has no xsi:type, one has to guess which subtype to instantiate. Candidate subtypes can be derived
                when looking at sub-items. However, if there are more candidates, one of them must be selected.
                This is done using instantiationOrder annotation.

                EXPERIMENTAL. Maybe this is really a wrong idea, so be prepared it could be removed.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="SchemaMigrationType">
        <xsd:annotation>
            <xsd:documentation>
                <p>
                    Annotation that describes schema changes that need to be migrated.
                    I.e. incompatible schema changes.
                </p>
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element minOccurs="1" name="element" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Name of the element that was changed. This is the original name
                            used in previous schema versions.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="version" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Version of the schema in which the change was applied.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="1" name="operation" type="tns:SchemaMigrationOperationType">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Operation that needs to be done to migrate old schema to new schema.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="replacement" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Name of the element that replaced removed or deprecated element.
                            EXPERIMENTAL. May be changed to a path later on.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="comment" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            A human-readable description of this schema change.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <!-- TODO: replacement element -->
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="schemaMigration" type="tns:SchemaMigrationType">
        <xsd:annotation>
            <xsd:documentation>
                Annotation that describes schema changes that need to be migrated.
                I.e. incompatible schema changes.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:simpleType name="SchemaMigrationOperationType">
        <xsd:annotation>
            <xsd:documentation>
                Operation that needs to be done to migrate old schema to new schema.
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="removed">
                <xsd:annotation>
                    <xsd:documentation>
                        Element was removed. There is no replacement.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="REMOVED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="moved">
                <xsd:annotation>
                    <xsd:documentation>
                        Element was moved or renamed.
                        NOT SUPPORTED NOW
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="MOVED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="renamedParent">
                <xsd:annotation>
                    <xsd:documentation>
                        Parent (root) element was renamed, e.g. top-level element of the object.
                        This is different than "moved" as "moved" refers to child elements.
                        The "renamedParent" refers to parent element.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="RENAMED_PARENT"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <!-- TODO: moved, deprecated -->
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:element name="valueMetadata">
        <xsd:annotation>
            <xsd:documentation>
                EXPERIMENTAL: Value Metadata marker. This annotation marks elements to be considered as value metadata.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="alwaysUseForEquals" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                EXPERIMENTAL: Item which should always be used for equals even if it is operational
                and strategy does not consider operational items.

                USE WITH CARE
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="DiagramType">
        <xsd:annotation>
            <xsd:documentation>
                <p>
                    Annotation that describes how the item should be presented in data model diagrams.
                    EXPERIMENTAL
                </p>
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element maxOccurs="1" minOccurs="1" name="name" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Name of the diagram in which the item should appear.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="form" type="tns:DiagramElementFormType">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            The form in which this item should be presented in the diagram (collapsed/expanded).
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element default="auto" minOccurs="0" name="inclusion" type="tns:DiagramElementInclusionType">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Specifies whether the item that holds this annotation should be included/excluded in the diagram.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element default="auto" minOccurs="0" name="subitemInclusion" type="tns:DiagramElementInclusionType">
                <xsd:annotation>
                    <xsd:documentation>
                        <p>
                            Specifies whether the subitems of an item that holds this annotation should be included/excluded in the diagram.
                            This sets the default value for subitem inclusion.
                        </p>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <!-- TODO: later we may want to add:
                    * includeSupertypeItems
                    * some form of exlusion, e.g. to explicitly exclude an item from the diagram, where it is inlcuded implicitly
                      (e.g. because parent is included, or by using selector in diagrams.json)
              -->

        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="DiagramElementFormType">
        <xsd:annotation>
            <xsd:documentation>
                Presentation form of diagram element.
                EXPERIMENTAL
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="expanded">
                <xsd:annotation>
                    <xsd:documentation>
                        The element should be fully expanded.
                        All the details of the element (and its content) should be visible.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EXPANDED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="collapsed">
                <xsd:annotation>
                    <xsd:documentation>
                        The element should be collapsed.
                        Only the most important details about the element should be visible.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="COLLAPSED"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="DiagramElementInclusionType">
        <xsd:annotation>
            <xsd:documentation>
                Inclusion of diagram element.
                EXPERIMENTAL
            </xsd:documentation>
            <xsd:appinfo>
                <jaxb:typesafeEnumClass/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="auto">
                <xsd:annotation>
                    <xsd:documentation>
                        Automatic inclusion.
                        The element should be included in the diagram, if there is any setting for that element and a particular diagram.
                        For example, simply mentioning the diagram name in the annotation means that the item should be included.
                        Items that do not mention name of that particular diagram are not included.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="AUTO"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="include">
                <xsd:annotation>
                    <xsd:documentation>
                        Explicit inclusion.
                        The element should be included in the diagram.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="INCLUDE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="exclude">
                <xsd:annotation>
                    <xsd:documentation>
                        Explicit exclusion.
                        The element should be excluded from the diagram.
                    </xsd:documentation>
                    <xsd:appinfo>
                        <jaxb:typesafeEnumMember name="EXCLUDE"/>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:element name="merger" type="xsd:string">
        <xsd:annotation>
            <xsd:documentation>
                Identifier of the implementation strategy that should be used to merge two items of the same type.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:element name="naturalKey" type="xsd:QName">
        <xsd:annotation>
            <xsd:documentation>
                Identifier(s) of the item that has to be used to decide whether two items represent the same object.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="SchemaContextType">
        <xsd:sequence>
            <xsd:element minOccurs="0" name="type" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        Name object type.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="path" type="xsd:string">
                <xsd:annotation>
                    <xsd:documentation>
                        Name object type.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="typePath" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        Name of element which have path to object type.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element minOccurs="0" name="algorithm" type="xsd:QName">
                <xsd:annotation>
                    <xsd:documentation>
                        Algorithm for handling schema context definition.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="schemaContext" type="tns:SchemaContextType">
        <xsd:annotation>
            <xsd:documentation>
                Schema context defines semantics information about annotated element.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

</xsd:schema>