public RateCalculation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode typeNode = xmlNode.SelectSingleNode("type");
     
     if (typeNode != null)
     {
         if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null) 
         {
             if (typeNode.Attributes["id"] != null) 
             {
                 typeIDRef_ = typeNode.Attributes["id"].Value;
                 XsdTypeToken ob = new XsdTypeToken(typeNode);
                 IDManager.SetID(typeIDRef_, ob);
             }
             else if (typeNode.Attributes["href"] != null)
             {
                 typeIDRef_ = typeNode.Attributes["href"].Value;
             }
             else
             {
                 type_ = new XsdTypeToken(typeNode);
             }
         }
         else
         {
             type_ = new XsdTypeToken(typeNode);
         }
     }
     
 
     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 calculationStartDateNode = xmlNode.SelectSingleNode("calculationStartDate");
     
     if (calculationStartDateNode != null)
     {
         if (calculationStartDateNode.Attributes["href"] != null || calculationStartDateNode.Attributes["id"] != null) 
         {
             if (calculationStartDateNode.Attributes["id"] != null) 
             {
                 calculationStartDateIDRef_ = calculationStartDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(calculationStartDateNode);
                 IDManager.SetID(calculationStartDateIDRef_, ob);
             }
             else if (calculationStartDateNode.Attributes["href"] != null)
             {
                 calculationStartDateIDRef_ = calculationStartDateNode.Attributes["href"].Value;
             }
             else
             {
                 calculationStartDate_ = new XsdTypeDate(calculationStartDateNode);
             }
         }
         else
         {
             calculationStartDate_ = new XsdTypeDate(calculationStartDateNode);
         }
     }
     
 
     XmlNode calculationEndDateNode = xmlNode.SelectSingleNode("calculationEndDate");
     
     if (calculationEndDateNode != null)
     {
         if (calculationEndDateNode.Attributes["href"] != null || calculationEndDateNode.Attributes["id"] != null) 
         {
             if (calculationEndDateNode.Attributes["id"] != null) 
             {
                 calculationEndDateIDRef_ = calculationEndDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(calculationEndDateNode);
                 IDManager.SetID(calculationEndDateIDRef_, ob);
             }
             else if (calculationEndDateNode.Attributes["href"] != null)
             {
                 calculationEndDateIDRef_ = calculationEndDateNode.Attributes["href"].Value;
             }
             else
             {
                 calculationEndDate_ = new XsdTypeDate(calculationEndDateNode);
             }
         }
         else
         {
             calculationEndDate_ = new XsdTypeDate(calculationEndDateNode);
         }
     }
     
 
     XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");
     
     if (paymentDateNode != null)
     {
         if (paymentDateNode.Attributes["href"] != null || paymentDateNode.Attributes["id"] != null) 
         {
             if (paymentDateNode.Attributes["id"] != null) 
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(paymentDateNode);
                 IDManager.SetID(paymentDateIDRef_, ob);
             }
             else if (paymentDateNode.Attributes["href"] != null)
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDate_ = new XsdTypeDate(paymentDateNode);
             }
         }
         else
         {
             paymentDate_ = new XsdTypeDate(paymentDateNode);
         }
     }
     
 
     XmlNode vanillaRateCalculationNode = xmlNode.SelectSingleNode("vanillaRateCalculation");
     
     if (vanillaRateCalculationNode != null)
     {
         if (vanillaRateCalculationNode.Attributes["href"] != null || vanillaRateCalculationNode.Attributes["id"] != null) 
         {
             if (vanillaRateCalculationNode.Attributes["id"] != null) 
             {
                 vanillaRateCalculationIDRef_ = vanillaRateCalculationNode.Attributes["id"].Value;
                 VanillaRateCalculation ob = new VanillaRateCalculation(vanillaRateCalculationNode);
                 IDManager.SetID(vanillaRateCalculationIDRef_, ob);
             }
             else if (vanillaRateCalculationNode.Attributes["href"] != null)
             {
                 vanillaRateCalculationIDRef_ = vanillaRateCalculationNode.Attributes["href"].Value;
             }
             else
             {
                 vanillaRateCalculation_ = new VanillaRateCalculation(vanillaRateCalculationNode);
             }
         }
         else
         {
             vanillaRateCalculation_ = new VanillaRateCalculation(vanillaRateCalculationNode);
         }
     }
     
 
 }
        public RateCalculation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode typeNode = xmlNode.SelectSingleNode("type");

            if (typeNode != null)
            {
                if (typeNode.Attributes["href"] != null || typeNode.Attributes["id"] != null)
                {
                    if (typeNode.Attributes["id"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["id"].Value;
                        XsdTypeToken ob = new XsdTypeToken(typeNode);
                        IDManager.SetID(typeIDRef_, ob);
                    }
                    else if (typeNode.Attributes["href"] != null)
                    {
                        typeIDRef_ = typeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        type_ = new XsdTypeToken(typeNode);
                    }
                }
                else
                {
                    type_ = new XsdTypeToken(typeNode);
                }
            }


            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 calculationStartDateNode = xmlNode.SelectSingleNode("calculationStartDate");

            if (calculationStartDateNode != null)
            {
                if (calculationStartDateNode.Attributes["href"] != null || calculationStartDateNode.Attributes["id"] != null)
                {
                    if (calculationStartDateNode.Attributes["id"] != null)
                    {
                        calculationStartDateIDRef_ = calculationStartDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(calculationStartDateNode);
                        IDManager.SetID(calculationStartDateIDRef_, ob);
                    }
                    else if (calculationStartDateNode.Attributes["href"] != null)
                    {
                        calculationStartDateIDRef_ = calculationStartDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationStartDate_ = new XsdTypeDate(calculationStartDateNode);
                    }
                }
                else
                {
                    calculationStartDate_ = new XsdTypeDate(calculationStartDateNode);
                }
            }


            XmlNode calculationEndDateNode = xmlNode.SelectSingleNode("calculationEndDate");

            if (calculationEndDateNode != null)
            {
                if (calculationEndDateNode.Attributes["href"] != null || calculationEndDateNode.Attributes["id"] != null)
                {
                    if (calculationEndDateNode.Attributes["id"] != null)
                    {
                        calculationEndDateIDRef_ = calculationEndDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(calculationEndDateNode);
                        IDManager.SetID(calculationEndDateIDRef_, ob);
                    }
                    else if (calculationEndDateNode.Attributes["href"] != null)
                    {
                        calculationEndDateIDRef_ = calculationEndDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationEndDate_ = new XsdTypeDate(calculationEndDateNode);
                    }
                }
                else
                {
                    calculationEndDate_ = new XsdTypeDate(calculationEndDateNode);
                }
            }


            XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");

            if (paymentDateNode != null)
            {
                if (paymentDateNode.Attributes["href"] != null || paymentDateNode.Attributes["id"] != null)
                {
                    if (paymentDateNode.Attributes["id"] != null)
                    {
                        paymentDateIDRef_ = paymentDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(paymentDateNode);
                        IDManager.SetID(paymentDateIDRef_, ob);
                    }
                    else if (paymentDateNode.Attributes["href"] != null)
                    {
                        paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDate_ = new XsdTypeDate(paymentDateNode);
                    }
                }
                else
                {
                    paymentDate_ = new XsdTypeDate(paymentDateNode);
                }
            }


            XmlNode vanillaRateCalculationNode = xmlNode.SelectSingleNode("vanillaRateCalculation");

            if (vanillaRateCalculationNode != null)
            {
                if (vanillaRateCalculationNode.Attributes["href"] != null || vanillaRateCalculationNode.Attributes["id"] != null)
                {
                    if (vanillaRateCalculationNode.Attributes["id"] != null)
                    {
                        vanillaRateCalculationIDRef_ = vanillaRateCalculationNode.Attributes["id"].Value;
                        VanillaRateCalculation ob = new VanillaRateCalculation(vanillaRateCalculationNode);
                        IDManager.SetID(vanillaRateCalculationIDRef_, ob);
                    }
                    else if (vanillaRateCalculationNode.Attributes["href"] != null)
                    {
                        vanillaRateCalculationIDRef_ = vanillaRateCalculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vanillaRateCalculation_ = new VanillaRateCalculation(vanillaRateCalculationNode);
                    }
                }
                else
                {
                    vanillaRateCalculation_ = new VanillaRateCalculation(vanillaRateCalculationNode);
                }
            }
        }