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

        /// <summary>
        /// Initializes a new instance of the <see cref="ReportingCategoryCore"/> class.
        /// </summary>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <param name="reportingCategory">
        /// The reporting category. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        public ReportingCategoryCore(IIdentifiableObject parent, IReportingCategoryMutableObject reportingCategory)
            : base(reportingCategory, parent)
        {
            this.structuralMetadata = new List<ICrossReference>();
            this.provisioningMetadata = new List<ICrossReference>();
            this.reportingCategories = new List<IReportingCategoryObject>();

            if (reportingCategory.ProvisioningMetadata != null)
            {
                foreach (IStructureReference structureReference in reportingCategory.ProvisioningMetadata)
                {
                    this.provisioningMetadata.Add(new CrossReferenceImpl(this, structureReference));
                }
            }

            if (reportingCategory.StructuralMetadata != null)
            {
                foreach (IStructureReference structureReference in reportingCategory.StructuralMetadata)
                {
                    this.structuralMetadata.Add(new CrossReferenceImpl(this, structureReference));
                }
            }

            if (reportingCategory.Items != null)
            {
                foreach (IReportingCategoryMutableObject reportingCategoryMutableObject in reportingCategory.Items)
                {
                    this.reportingCategories.Add(new ReportingCategoryCore(this, reportingCategoryMutableObject));
                }
            }

            try
            {
                this.Validate();
            }
            catch (SdmxSemmanticException ex)
            {
                throw new SdmxSemmanticException(ex, ExceptionCode.ObjectStructureConstructionError, this.Urn);
            }
            catch (Exception th)
            {
                throw new SdmxException(th, ExceptionCode.ObjectStructureConstructionError, this.Urn);
            }
        }
 /// <summary>
 /// The add item.
 /// </summary>
 /// <param name="item">
 /// The reporting category. 
 /// </param>
 public void AddItem(IReportingCategoryMutableObject item)
 {
     this._reportingCategories.Add(item);
 }