///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="RepresentationCore"/> class.
        /// </summary>
        /// <param name="textFormat0">
        /// The text format 0. 
        /// </param>
        /// <param name="codelistAgency">
        /// The codelist agency. 
        /// </param>
        /// <param name="codelistId">
        /// The codelist id. 
        /// </param>
        /// <param name="codelistVersion">
        /// The codelist version. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public RepresentationCore(
            TextFormatType textFormat0, 
            string codelistAgency, 
            string codelistId, 
            string codelistVersion, 
            IIdentifiableObject parent)
            : base(_localRepresentation, parent)
        {
            if (textFormat0 != null)
            {
                this.textFormat = new TextFormatObjectCore(textFormat0, this);
            }

            if (ObjectUtil.ValidOneString(codelistAgency, codelistId, codelistVersion))
            {
                if (string.IsNullOrWhiteSpace(codelistAgency))
                {
                    codelistAgency = this.MaintainableParent.AgencyId;
                }

                SdmxStructureType structureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CodeList);
                if (parent.MaintainableParent is ICrossSectionalDataStructureObject)
                {
                    if (parent is IDimension)
                    {
                        if (((IDimension)parent).MeasureDimension)
                        {
                            structureType = SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConceptScheme);
                        }
                    }
                }

                this.representation = new CrossReferenceImpl(
                    this, codelistAgency, codelistId, codelistVersion, structureType);
            }

            this.Validate();
        }
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////

		/// <summary>
		/// Initializes a new instance of the <see cref="ComponentCore"/> class.
		/// </summary>
		/// <param name="createdFrom">
		/// The created from. 
		/// </param>
		/// <param name="structureType">
		/// The structure type. 
		/// </param>
		/// <param name="annotationType">
		/// The annotation type. 
		/// </param>
		/// <param name="textFormat">
		/// The text format. 
		/// </param>
		/// <param name="codelistAgency">
		/// The codelist agency. 
		/// </param>
		/// <param name="codelistId">
		/// The codelist id. 
		/// </param>
		/// <param name="codelistVersion">
		/// The codelist version. 
		/// </param>
		/// <param name="conceptSchemeAgency">
		/// The concept scheme agency. 
		/// </param>
		/// <param name="conceptSchemeId">
		/// The concept scheme id. 
		/// </param>
		/// <param name="conceptSchemeVersion">
		/// The concept scheme version. 
		/// </param>
		/// <param name="conceptAgency">
		/// The concept agency. 
		/// </param>
		/// <param name="conceptId">
		/// The concept id. 
		/// </param>
		/// <param name="parent">
		/// The parent. 
		/// </param>
		protected internal ComponentCore(
			IXmlSerializable createdFrom, 
			SdmxStructureType structureType, 
			AnnotationsType annotationType, 
			TextFormatType textFormat, 
			string codelistAgency, 
			string codelistId, 
			string codelistVersion, 
			string conceptSchemeAgency, 
			string conceptSchemeId, 
			string conceptSchemeVersion, 
			string conceptAgency, 
			string conceptId, 
			IIdentifiableObject parent)
			: base(createdFrom, structureType, conceptId, null, annotationType, parent)
		{
			if (string.IsNullOrWhiteSpace(conceptAgency))
			{
				conceptAgency = this.MaintainableParent.AgencyId;
			}

			if (textFormat != null || ObjectUtil.ValidOneString(codelistAgency, codelistId, codelistVersion))
			{
				if (ObjectUtil.ValidOneString(codelistAgency, codelistId, codelistVersion))
				{
					if (string.IsNullOrWhiteSpace(codelistAgency))
					{
						codelistAgency = this.MaintainableParent.AgencyId;
					}
				}

				this.LocalRepresentation = new RepresentationCore(
					textFormat, codelistAgency, codelistId, codelistVersion, this);
			}

			this._conceptRef = ConceptRefUtil.BuildConceptRef(
				this, conceptSchemeAgency, conceptSchemeId, conceptSchemeVersion, conceptAgency, conceptId);
			this.ValidateComponentAttributes();
		}