internal XSElementDeclaration(XmlSchemaElement element)
            : this()
        {
            _element = element;

            if (_element.Annotation is XmlSchemaAnnotation annotation)
            {
                _annotation = XMLSchemaSerializer.CreateXSAnnotation(annotation);
                _annotation.BindToContainer(RootContainer, this);
            }

            if (element.SchemaTypeName is XmlQualifiedName schemaTypeName)
            {
                _typeName = XMLSchemaSerializer.CreateXMLExpandedName(schemaTypeName);
            }

            if (element.RefName is XmlQualifiedName refName)
            {
                _refName = XMLSchemaSerializer.CreateXMLExpandedName(refName);
            }

            if (element.SubstitutionGroup is XmlQualifiedName substitutionGroup)
            {
                _substitutionGroup = XMLSchemaSerializer.CreateXMLExpandedName(substitutionGroup);
            }

            if (_element.SchemaType is XmlSchemaType schemaType)
            {
                _schemaType = XMLSchemaSerializer.CreateIXSType(schemaType);
            }
        }