///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECT                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ReferencePeriodCore"/> class.
        /// </summary>
        /// <param name="mutable">
        /// The mutable. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        public ReferencePeriodCore(IReferencePeriodMutableObject mutable, IContentConstraintObject parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ReferencePeriod), parent)
        {
            // These items are mandatory and thus should exist
            if (mutable.StartTime != null)
            {
                this.startTime = new SdmxDateCore(mutable.StartTime, TimeFormatEnumType.DateTime);
            }

            if (mutable.EndTime != null)
            {
                this.endTime = new SdmxDateCore(mutable.EndTime, TimeFormatEnumType.DateTime);
            }

            if (this.startTime == null)
            {
                throw new SdmxSemmanticException("ReferencePeriodCore - start time can not be null");
            }

            if (this.endTime == null)
            {
                throw new SdmxSemmanticException("ReferencePeriodCore - end time can not be null");
            }
        }
 /// <summary>
 /// Write ReferencePeriod
 /// </summary>
 /// <param name="period">
 /// The IReferencePeriodMutableObject to write
 /// </param>
 private void WriteReferencePeriod(IReferencePeriodMutableObject period)
 {
     if (period != null)
     {
         this.WriteStartElement(this._commonPrefix, ElementNameTable.ReferencePeriod);
         this.TryWriteAttribute(AttributeNameTable.startTime, period.StartTime);
         this.TryWriteAttribute(AttributeNameTable.endTime, period.EndTime);
         this.WriteEndElement();
     }
 }