public ProtectionTerms(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode calculationAmountNode = xmlNode.SelectSingleNode("calculationAmount");
     
     if (calculationAmountNode != null)
     {
         if (calculationAmountNode.Attributes["href"] != null || calculationAmountNode.Attributes["id"] != null) 
         {
             if (calculationAmountNode.Attributes["id"] != null) 
             {
                 calculationAmountIDRef_ = calculationAmountNode.Attributes["id"].Value;
                 CalculationAmount ob = new CalculationAmount(calculationAmountNode);
                 IDManager.SetID(calculationAmountIDRef_, ob);
             }
             else if (calculationAmountNode.Attributes["href"] != null)
             {
                 calculationAmountIDRef_ = calculationAmountNode.Attributes["href"].Value;
             }
             else
             {
                 calculationAmount_ = new CalculationAmount(calculationAmountNode);
             }
         }
         else
         {
             calculationAmount_ = new CalculationAmount(calculationAmountNode);
         }
     }
     
 
     XmlNode creditEventsNode = xmlNode.SelectSingleNode("creditEvents");
     
     if (creditEventsNode != null)
     {
         if (creditEventsNode.Attributes["href"] != null || creditEventsNode.Attributes["id"] != null) 
         {
             if (creditEventsNode.Attributes["id"] != null) 
             {
                 creditEventsIDRef_ = creditEventsNode.Attributes["id"].Value;
                 CreditEvents ob = new CreditEvents(creditEventsNode);
                 IDManager.SetID(creditEventsIDRef_, ob);
             }
             else if (creditEventsNode.Attributes["href"] != null)
             {
                 creditEventsIDRef_ = creditEventsNode.Attributes["href"].Value;
             }
             else
             {
                 creditEvents_ = new CreditEvents(creditEventsNode);
             }
         }
         else
         {
             creditEvents_ = new CreditEvents(creditEventsNode);
         }
     }
     
 
     XmlNode accrualCouponNode = xmlNode.SelectSingleNode("accrualCoupon");
     
     if (accrualCouponNode != null)
     {
         if (accrualCouponNode.Attributes["href"] != null || accrualCouponNode.Attributes["id"] != null) 
         {
             if (accrualCouponNode.Attributes["id"] != null) 
             {
                 accrualCouponIDRef_ = accrualCouponNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(accrualCouponNode);
                 IDManager.SetID(accrualCouponIDRef_, ob);
             }
             else if (accrualCouponNode.Attributes["href"] != null)
             {
                 accrualCouponIDRef_ = accrualCouponNode.Attributes["href"].Value;
             }
             else
             {
                 accrualCoupon_ = new XsdTypeBoolean(accrualCouponNode);
             }
         }
         else
         {
             accrualCoupon_ = new XsdTypeBoolean(accrualCouponNode);
         }
     }
     
 
 }
        public ProtectionTerms(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode calculationAmountNode = xmlNode.SelectSingleNode("calculationAmount");

            if (calculationAmountNode != null)
            {
                if (calculationAmountNode.Attributes["href"] != null || calculationAmountNode.Attributes["id"] != null)
                {
                    if (calculationAmountNode.Attributes["id"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["id"].Value;
                        CalculationAmount ob = new CalculationAmount(calculationAmountNode);
                        IDManager.SetID(calculationAmountIDRef_, ob);
                    }
                    else if (calculationAmountNode.Attributes["href"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationAmount_ = new CalculationAmount(calculationAmountNode);
                    }
                }
                else
                {
                    calculationAmount_ = new CalculationAmount(calculationAmountNode);
                }
            }


            XmlNode creditEventsNode = xmlNode.SelectSingleNode("creditEvents");

            if (creditEventsNode != null)
            {
                if (creditEventsNode.Attributes["href"] != null || creditEventsNode.Attributes["id"] != null)
                {
                    if (creditEventsNode.Attributes["id"] != null)
                    {
                        creditEventsIDRef_ = creditEventsNode.Attributes["id"].Value;
                        CreditEvents ob = new CreditEvents(creditEventsNode);
                        IDManager.SetID(creditEventsIDRef_, ob);
                    }
                    else if (creditEventsNode.Attributes["href"] != null)
                    {
                        creditEventsIDRef_ = creditEventsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        creditEvents_ = new CreditEvents(creditEventsNode);
                    }
                }
                else
                {
                    creditEvents_ = new CreditEvents(creditEventsNode);
                }
            }


            XmlNode accrualCouponNode = xmlNode.SelectSingleNode("accrualCoupon");

            if (accrualCouponNode != null)
            {
                if (accrualCouponNode.Attributes["href"] != null || accrualCouponNode.Attributes["id"] != null)
                {
                    if (accrualCouponNode.Attributes["id"] != null)
                    {
                        accrualCouponIDRef_ = accrualCouponNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(accrualCouponNode);
                        IDManager.SetID(accrualCouponIDRef_, ob);
                    }
                    else if (accrualCouponNode.Attributes["href"] != null)
                    {
                        accrualCouponIDRef_ = accrualCouponNode.Attributes["href"].Value;
                    }
                    else
                    {
                        accrualCoupon_ = new XsdTypeBoolean(accrualCouponNode);
                    }
                }
                else
                {
                    accrualCoupon_ = new XsdTypeBoolean(accrualCouponNode);
                }
            }
        }