public EnvironmentalProduct(XmlNode xmlNode)
        {
            XmlNodeList productTypeNodeList = xmlNode.SelectNodes("productType");

            if (productTypeNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in productTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        productTypeIDRef = item.Attributes["id"].Name;
                        EnvironmentalProductTypeEnum ob = EnvironmentalProductTypeEnum();
                        IDManager.SetID(productTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        productTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        productType = new EnvironmentalProductTypeEnum(item);
                    }
                }
            }


            XmlNodeList compliancePeriodNodeList = xmlNode.SelectNodes("compliancePeriod");

            if (compliancePeriodNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in compliancePeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        compliancePeriodIDRef = item.Attributes["id"].Name;
                        EnvironmentalProductComplaincePeriod ob = EnvironmentalProductComplaincePeriod();
                        IDManager.SetID(compliancePeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        compliancePeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        compliancePeriod = new EnvironmentalProductComplaincePeriod(item);
                    }
                }
            }


            XmlNodeList vintageNodeList = xmlNode.SelectNodes("vintage");

            foreach (XmlNode item in vintageNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        vintageIDRef = item.Attributes["id"].Name;
                        XsdTypeGYear ob = new XsdTypeGYear();
                        ob.Add(new XsdTypeGYear(item));
                        IDManager.SetID(vintageIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        vintageIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        vintage.Add(new XsdTypeGYear(item));
                    }
                }
            }


            XmlNodeList applicableLawNodeList = xmlNode.SelectNodes("applicableLaw");

            if (applicableLawNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in applicableLawNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        applicableLawIDRef = item.Attributes["id"].Name;
                        EnvironmentalProductApplicableLaw ob = EnvironmentalProductApplicableLaw();
                        IDManager.SetID(applicableLawIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        applicableLawIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        applicableLaw = new EnvironmentalProductApplicableLaw(item);
                    }
                }
            }


            XmlNodeList trackingSystemNodeList = xmlNode.SelectNodes("trackingSystem");

            if (trackingSystemNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in trackingSystemNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        trackingSystemIDRef = item.Attributes["id"].Name;
                        EnvironmentalTrackingSystem ob = EnvironmentalTrackingSystem();
                        IDManager.SetID(trackingSystemIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        trackingSystemIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        trackingSystem = new EnvironmentalTrackingSystem(item);
                    }
                }
            }
        }
 public EnvironmentalProduct(XmlNode xmlNode)
 {
     XmlNode productTypeNode = xmlNode.SelectSingleNode("productType");
     
     if (productTypeNode != null)
     {
         if (productTypeNode.Attributes["href"] != null || productTypeNode.Attributes["id"] != null) 
         {
             if (productTypeNode.Attributes["id"] != null) 
             {
                 productTypeIDRef_ = productTypeNode.Attributes["id"].Value;
                 EnvironmentalProductTypeEnum ob = new EnvironmentalProductTypeEnum(productTypeNode);
                 IDManager.SetID(productTypeIDRef_, ob);
             }
             else if (productTypeNode.Attributes["href"] != null)
             {
                 productTypeIDRef_ = productTypeNode.Attributes["href"].Value;
             }
             else
             {
                 productType_ = new EnvironmentalProductTypeEnum(productTypeNode);
             }
         }
         else
         {
             productType_ = new EnvironmentalProductTypeEnum(productTypeNode);
         }
     }
     
 
     XmlNode compliancePeriodNode = xmlNode.SelectSingleNode("compliancePeriod");
     
     if (compliancePeriodNode != null)
     {
         if (compliancePeriodNode.Attributes["href"] != null || compliancePeriodNode.Attributes["id"] != null) 
         {
             if (compliancePeriodNode.Attributes["id"] != null) 
             {
                 compliancePeriodIDRef_ = compliancePeriodNode.Attributes["id"].Value;
                 EnvironmentalProductComplaincePeriod ob = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
                 IDManager.SetID(compliancePeriodIDRef_, ob);
             }
             else if (compliancePeriodNode.Attributes["href"] != null)
             {
                 compliancePeriodIDRef_ = compliancePeriodNode.Attributes["href"].Value;
             }
             else
             {
                 compliancePeriod_ = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
             }
         }
         else
         {
             compliancePeriod_ = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
         }
     }
     
 
     XmlNodeList vintageNodeList = xmlNode.SelectNodes("vintage");
     
     if (vintageNodeList != null)
     {
         this.vintage_ = new List<XsdTypeGYear>();
         foreach (XmlNode item in vintageNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     vintageIDRef_ = item.Attributes["id"].Value;
                     vintage_.Add(new XsdTypeGYear(item));
                     IDManager.SetID(vintageIDRef_, vintage_[vintage_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     vintageIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 vintage_.Add(new XsdTypeGYear(item));
                 }
             }
             else
             {
                 vintage_.Add(new XsdTypeGYear(item));
             }
         }
     }
     
 
     XmlNode applicableLawNode = xmlNode.SelectSingleNode("applicableLaw");
     
     if (applicableLawNode != null)
     {
         if (applicableLawNode.Attributes["href"] != null || applicableLawNode.Attributes["id"] != null) 
         {
             if (applicableLawNode.Attributes["id"] != null) 
             {
                 applicableLawIDRef_ = applicableLawNode.Attributes["id"].Value;
                 EnvironmentalProductApplicableLaw ob = new EnvironmentalProductApplicableLaw(applicableLawNode);
                 IDManager.SetID(applicableLawIDRef_, ob);
             }
             else if (applicableLawNode.Attributes["href"] != null)
             {
                 applicableLawIDRef_ = applicableLawNode.Attributes["href"].Value;
             }
             else
             {
                 applicableLaw_ = new EnvironmentalProductApplicableLaw(applicableLawNode);
             }
         }
         else
         {
             applicableLaw_ = new EnvironmentalProductApplicableLaw(applicableLawNode);
         }
     }
     
 
     XmlNode trackingSystemNode = xmlNode.SelectSingleNode("trackingSystem");
     
     if (trackingSystemNode != null)
     {
         if (trackingSystemNode.Attributes["href"] != null || trackingSystemNode.Attributes["id"] != null) 
         {
             if (trackingSystemNode.Attributes["id"] != null) 
             {
                 trackingSystemIDRef_ = trackingSystemNode.Attributes["id"].Value;
                 EnvironmentalTrackingSystem ob = new EnvironmentalTrackingSystem(trackingSystemNode);
                 IDManager.SetID(trackingSystemIDRef_, ob);
             }
             else if (trackingSystemNode.Attributes["href"] != null)
             {
                 trackingSystemIDRef_ = trackingSystemNode.Attributes["href"].Value;
             }
             else
             {
                 trackingSystem_ = new EnvironmentalTrackingSystem(trackingSystemNode);
             }
         }
         else
         {
             trackingSystem_ = new EnvironmentalTrackingSystem(trackingSystemNode);
         }
     }
     
 
 }
        public EnvironmentalProduct(XmlNode xmlNode)
        {
            XmlNode productTypeNode = xmlNode.SelectSingleNode("productType");

            if (productTypeNode != null)
            {
                if (productTypeNode.Attributes["href"] != null || productTypeNode.Attributes["id"] != null)
                {
                    if (productTypeNode.Attributes["id"] != null)
                    {
                        productTypeIDRef_ = productTypeNode.Attributes["id"].Value;
                        EnvironmentalProductTypeEnum ob = new EnvironmentalProductTypeEnum(productTypeNode);
                        IDManager.SetID(productTypeIDRef_, ob);
                    }
                    else if (productTypeNode.Attributes["href"] != null)
                    {
                        productTypeIDRef_ = productTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        productType_ = new EnvironmentalProductTypeEnum(productTypeNode);
                    }
                }
                else
                {
                    productType_ = new EnvironmentalProductTypeEnum(productTypeNode);
                }
            }


            XmlNode compliancePeriodNode = xmlNode.SelectSingleNode("compliancePeriod");

            if (compliancePeriodNode != null)
            {
                if (compliancePeriodNode.Attributes["href"] != null || compliancePeriodNode.Attributes["id"] != null)
                {
                    if (compliancePeriodNode.Attributes["id"] != null)
                    {
                        compliancePeriodIDRef_ = compliancePeriodNode.Attributes["id"].Value;
                        EnvironmentalProductComplaincePeriod ob = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
                        IDManager.SetID(compliancePeriodIDRef_, ob);
                    }
                    else if (compliancePeriodNode.Attributes["href"] != null)
                    {
                        compliancePeriodIDRef_ = compliancePeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        compliancePeriod_ = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
                    }
                }
                else
                {
                    compliancePeriod_ = new EnvironmentalProductComplaincePeriod(compliancePeriodNode);
                }
            }


            XmlNodeList vintageNodeList = xmlNode.SelectNodes("vintage");

            if (vintageNodeList != null)
            {
                this.vintage_ = new List <XsdTypeGYear>();
                foreach (XmlNode item in vintageNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            vintageIDRef_ = item.Attributes["id"].Value;
                            vintage_.Add(new XsdTypeGYear(item));
                            IDManager.SetID(vintageIDRef_, vintage_[vintage_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            vintageIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            vintage_.Add(new XsdTypeGYear(item));
                        }
                    }
                    else
                    {
                        vintage_.Add(new XsdTypeGYear(item));
                    }
                }
            }


            XmlNode applicableLawNode = xmlNode.SelectSingleNode("applicableLaw");

            if (applicableLawNode != null)
            {
                if (applicableLawNode.Attributes["href"] != null || applicableLawNode.Attributes["id"] != null)
                {
                    if (applicableLawNode.Attributes["id"] != null)
                    {
                        applicableLawIDRef_ = applicableLawNode.Attributes["id"].Value;
                        EnvironmentalProductApplicableLaw ob = new EnvironmentalProductApplicableLaw(applicableLawNode);
                        IDManager.SetID(applicableLawIDRef_, ob);
                    }
                    else if (applicableLawNode.Attributes["href"] != null)
                    {
                        applicableLawIDRef_ = applicableLawNode.Attributes["href"].Value;
                    }
                    else
                    {
                        applicableLaw_ = new EnvironmentalProductApplicableLaw(applicableLawNode);
                    }
                }
                else
                {
                    applicableLaw_ = new EnvironmentalProductApplicableLaw(applicableLawNode);
                }
            }


            XmlNode trackingSystemNode = xmlNode.SelectSingleNode("trackingSystem");

            if (trackingSystemNode != null)
            {
                if (trackingSystemNode.Attributes["href"] != null || trackingSystemNode.Attributes["id"] != null)
                {
                    if (trackingSystemNode.Attributes["id"] != null)
                    {
                        trackingSystemIDRef_ = trackingSystemNode.Attributes["id"].Value;
                        EnvironmentalTrackingSystem ob = new EnvironmentalTrackingSystem(trackingSystemNode);
                        IDManager.SetID(trackingSystemIDRef_, ob);
                    }
                    else if (trackingSystemNode.Attributes["href"] != null)
                    {
                        trackingSystemIDRef_ = trackingSystemNode.Attributes["href"].Value;
                    }
                    else
                    {
                        trackingSystem_ = new EnvironmentalTrackingSystem(trackingSystemNode);
                    }
                }
                else
                {
                    trackingSystem_ = new EnvironmentalTrackingSystem(trackingSystemNode);
                }
            }
        }