public OptionalEarlyTermination(XmlNode xmlNode)
        {
            XmlNode singlePartyOptionNode = xmlNode.SelectSingleNode("singlePartyOption");

            if (singlePartyOptionNode != null)
            {
                if (singlePartyOptionNode.Attributes["href"] != null || singlePartyOptionNode.Attributes["id"] != null)
                {
                    if (singlePartyOptionNode.Attributes["id"] != null)
                    {
                        singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["id"].Value;
                        SinglePartyOption ob = new SinglePartyOption(singlePartyOptionNode);
                        IDManager.SetID(singlePartyOptionIDRef_, ob);
                    }
                    else if (singlePartyOptionNode.Attributes["href"] != null)
                    {
                        singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode);
                    }
                }
                else
                {
                    singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode);
                }
            }


            XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise");

            if (exerciseNode != null)
            {
                if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null)
                {
                    if (exerciseNode.Attributes["id"] != null)
                    {
                        exerciseIDRef_ = exerciseNode.Attributes["id"].Value;
                        Exercise ob = new Exercise(exerciseNode);
                        IDManager.SetID(exerciseIDRef_, ob);
                    }
                    else if (exerciseNode.Attributes["href"] != null)
                    {
                        exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exercise_ = new Exercise(exerciseNode);
                    }
                }
                else
                {
                    exercise_ = new Exercise(exerciseNode);
                }
            }


            XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");

            if (americanExerciseNode != null)
            {
                if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null)
                {
                    if (americanExerciseNode.Attributes["id"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                        AmericanExercise ob = new AmericanExercise(americanExerciseNode);
                        IDManager.SetID(americanExerciseIDRef_, ob);
                    }
                    else if (americanExerciseNode.Attributes["href"] != null)
                    {
                        americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        americanExercise_ = new AmericanExercise(americanExerciseNode);
                    }
                }
                else
                {
                    americanExercise_ = new AmericanExercise(americanExerciseNode);
                }
            }


            XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise");

            if (bermudaExerciseNode != null)
            {
                if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null)
                {
                    if (bermudaExerciseNode.Attributes["id"] != null)
                    {
                        bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value;
                        BermudaExercise ob = new BermudaExercise(bermudaExerciseNode);
                        IDManager.SetID(bermudaExerciseIDRef_, ob);
                    }
                    else if (bermudaExerciseNode.Attributes["href"] != null)
                    {
                        bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
                    }
                }
                else
                {
                    bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
                }
            }


            XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");

            if (europeanExerciseNode != null)
            {
                if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null)
                {
                    if (europeanExerciseNode.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                        EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode);
                        IDManager.SetID(europeanExerciseIDRef_, ob);
                    }
                    else if (europeanExerciseNode.Attributes["href"] != null)
                    {
                        europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
                    }
                }
                else
                {
                    europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
                }
            }


            XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");

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


            XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation");

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


            XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent");

            if (calculationAgentNode != null)
            {
                if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null)
                {
                    if (calculationAgentNode.Attributes["id"] != null)
                    {
                        calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value;
                        CalculationAgent ob = new CalculationAgent(calculationAgentNode);
                        IDManager.SetID(calculationAgentIDRef_, ob);
                    }
                    else if (calculationAgentNode.Attributes["href"] != null)
                    {
                        calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationAgent_ = new CalculationAgent(calculationAgentNode);
                    }
                }
                else
                {
                    calculationAgent_ = new CalculationAgent(calculationAgentNode);
                }
            }


            XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");

            if (cashSettlementNode != null)
            {
                if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null)
                {
                    if (cashSettlementNode.Attributes["id"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                        CashSettlement ob = new CashSettlement(cashSettlementNode);
                        IDManager.SetID(cashSettlementIDRef_, ob);
                    }
                    else if (cashSettlementNode.Attributes["href"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashSettlement_ = new CashSettlement(cashSettlementNode);
                    }
                }
                else
                {
                    cashSettlement_ = new CashSettlement(cashSettlementNode);
                }
            }


            XmlNode optionalEarlyTerminationAdjustedDatesNode = xmlNode.SelectSingleNode("optionalEarlyTerminationAdjustedDates");

            if (optionalEarlyTerminationAdjustedDatesNode != null)
            {
                if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null || optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null)
                {
                    if (optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null)
                    {
                        optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["id"].Value;
                        OptionalEarlyTerminationAdjustedDates ob = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
                        IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef_, ob);
                    }
                    else if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null)
                    {
                        optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
                    }
                }
                else
                {
                    optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
                }
            }
        }
 public OptionalEarlyTermination(XmlNode xmlNode)
 {
     XmlNodeList singlePartyOptionNodeList = xmlNode.SelectNodes("singlePartyOption");
     if (singlePartyOptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in singlePartyOptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 singlePartyOptionIDRef = item.Attributes["id"].Name;
                 SinglePartyOption ob = SinglePartyOption();
                 IDManager.SetID(singlePartyOptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 singlePartyOptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 singlePartyOption = new SinglePartyOption(item);
             }
         }
     }
     
 
     XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise");
     if (exerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseIDRef = item.Attributes["id"].Name;
                 Exercise ob = Exercise();
                 IDManager.SetID(exerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exercise = new Exercise(item);
             }
         }
     }
     
 
     XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");
     if (americanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in americanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 americanExerciseIDRef = item.Attributes["id"].Name;
                 AmericanExercise ob = AmericanExercise();
                 IDManager.SetID(americanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 americanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 americanExercise = new AmericanExercise(item);
             }
         }
     }
     
 
     XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise");
     if (bermudaExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in bermudaExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 bermudaExerciseIDRef = item.Attributes["id"].Name;
                 BermudaExercise ob = BermudaExercise();
                 IDManager.SetID(bermudaExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 bermudaExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 bermudaExercise = new BermudaExercise(item);
             }
         }
     }
     
 
     XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");
     if (europeanExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in europeanExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef = item.Attributes["id"].Name;
                 EuropeanExercise ob = EuropeanExercise();
                 IDManager.SetID(europeanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 europeanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 europeanExercise = new EuropeanExercise(item);
             }
         }
     }
     
 
     XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");
     
     foreach (XmlNode item in exerciseNoticeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef = item.Attributes["id"].Name;
                 List<ExerciseNotice> ob = new List<ExerciseNotice>();
                 ob.Add(new ExerciseNotice(item));
                 IDManager.SetID(exerciseNoticeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseNoticeIDRef = item.Attributes["href"].Name;
             }
             else
             {
             exerciseNotice.Add(new ExerciseNotice(item));
             }
         }
     }
     
 
     XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation");
     if (followUpConfirmationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in followUpConfirmationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 followUpConfirmationIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(followUpConfirmationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 followUpConfirmationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 followUpConfirmation = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent");
     if (calculationAgentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationAgentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationAgentIDRef = item.Attributes["id"].Name;
                 CalculationAgent ob = CalculationAgent();
                 IDManager.SetID(calculationAgentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationAgentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationAgent = new CalculationAgent(item);
             }
         }
     }
     
 
     XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");
     if (cashSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashSettlementIDRef = item.Attributes["id"].Name;
                 CashSettlement ob = CashSettlement();
                 IDManager.SetID(cashSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cashSettlement = new CashSettlement(item);
             }
         }
     }
     
 
     XmlNodeList optionalEarlyTerminationAdjustedDatesNodeList = xmlNode.SelectNodes("optionalEarlyTerminationAdjustedDates");
     if (optionalEarlyTerminationAdjustedDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionalEarlyTerminationAdjustedDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["id"].Name;
                 OptionalEarlyTerminationAdjustedDates ob = OptionalEarlyTerminationAdjustedDates();
                 IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionalEarlyTerminationAdjustedDates = new OptionalEarlyTerminationAdjustedDates(item);
             }
         }
     }
     
 
 }
 public OptionalEarlyTermination(XmlNode xmlNode)
 {
     XmlNode singlePartyOptionNode = xmlNode.SelectSingleNode("singlePartyOption");
     
     if (singlePartyOptionNode != null)
     {
         if (singlePartyOptionNode.Attributes["href"] != null || singlePartyOptionNode.Attributes["id"] != null) 
         {
             if (singlePartyOptionNode.Attributes["id"] != null) 
             {
                 singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["id"].Value;
                 SinglePartyOption ob = new SinglePartyOption(singlePartyOptionNode);
                 IDManager.SetID(singlePartyOptionIDRef_, ob);
             }
             else if (singlePartyOptionNode.Attributes["href"] != null)
             {
                 singlePartyOptionIDRef_ = singlePartyOptionNode.Attributes["href"].Value;
             }
             else
             {
                 singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode);
             }
         }
         else
         {
             singlePartyOption_ = new SinglePartyOption(singlePartyOptionNode);
         }
     }
     
 
     XmlNode exerciseNode = xmlNode.SelectSingleNode("exercise");
     
     if (exerciseNode != null)
     {
         if (exerciseNode.Attributes["href"] != null || exerciseNode.Attributes["id"] != null) 
         {
             if (exerciseNode.Attributes["id"] != null) 
             {
                 exerciseIDRef_ = exerciseNode.Attributes["id"].Value;
                 Exercise ob = new Exercise(exerciseNode);
                 IDManager.SetID(exerciseIDRef_, ob);
             }
             else if (exerciseNode.Attributes["href"] != null)
             {
                 exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
             }
             else
             {
                 exercise_ = new Exercise(exerciseNode);
             }
         }
         else
         {
             exercise_ = new Exercise(exerciseNode);
         }
     }
     
 
     XmlNode americanExerciseNode = xmlNode.SelectSingleNode("americanExercise");
     
     if (americanExerciseNode != null)
     {
         if (americanExerciseNode.Attributes["href"] != null || americanExerciseNode.Attributes["id"] != null) 
         {
             if (americanExerciseNode.Attributes["id"] != null) 
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["id"].Value;
                 AmericanExercise ob = new AmericanExercise(americanExerciseNode);
                 IDManager.SetID(americanExerciseIDRef_, ob);
             }
             else if (americanExerciseNode.Attributes["href"] != null)
             {
                 americanExerciseIDRef_ = americanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 americanExercise_ = new AmericanExercise(americanExerciseNode);
             }
         }
         else
         {
             americanExercise_ = new AmericanExercise(americanExerciseNode);
         }
     }
     
 
     XmlNode bermudaExerciseNode = xmlNode.SelectSingleNode("bermudaExercise");
     
     if (bermudaExerciseNode != null)
     {
         if (bermudaExerciseNode.Attributes["href"] != null || bermudaExerciseNode.Attributes["id"] != null) 
         {
             if (bermudaExerciseNode.Attributes["id"] != null) 
             {
                 bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["id"].Value;
                 BermudaExercise ob = new BermudaExercise(bermudaExerciseNode);
                 IDManager.SetID(bermudaExerciseIDRef_, ob);
             }
             else if (bermudaExerciseNode.Attributes["href"] != null)
             {
                 bermudaExerciseIDRef_ = bermudaExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
             }
         }
         else
         {
             bermudaExercise_ = new BermudaExercise(bermudaExerciseNode);
         }
     }
     
 
     XmlNode europeanExerciseNode = xmlNode.SelectSingleNode("europeanExercise");
     
     if (europeanExerciseNode != null)
     {
         if (europeanExerciseNode.Attributes["href"] != null || europeanExerciseNode.Attributes["id"] != null) 
         {
             if (europeanExerciseNode.Attributes["id"] != null) 
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["id"].Value;
                 EuropeanExercise ob = new EuropeanExercise(europeanExerciseNode);
                 IDManager.SetID(europeanExerciseIDRef_, ob);
             }
             else if (europeanExerciseNode.Attributes["href"] != null)
             {
                 europeanExerciseIDRef_ = europeanExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
             }
         }
         else
         {
             europeanExercise_ = new EuropeanExercise(europeanExerciseNode);
         }
     }
     
 
     XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");
     
     if (exerciseNoticeNodeList != null)
     {
         this.exerciseNotice_ = new List<ExerciseNotice>();
         foreach (XmlNode item in exerciseNoticeNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     exerciseNoticeIDRef_ = item.Attributes["id"].Value;
                     exerciseNotice_.Add(new ExerciseNotice(item));
                     IDManager.SetID(exerciseNoticeIDRef_, exerciseNotice_[exerciseNotice_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     exerciseNoticeIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 exerciseNotice_.Add(new ExerciseNotice(item));
                 }
             }
             else
             {
                 exerciseNotice_.Add(new ExerciseNotice(item));
             }
         }
     }
     
 
     XmlNode followUpConfirmationNode = xmlNode.SelectSingleNode("followUpConfirmation");
     
     if (followUpConfirmationNode != null)
     {
         if (followUpConfirmationNode.Attributes["href"] != null || followUpConfirmationNode.Attributes["id"] != null) 
         {
             if (followUpConfirmationNode.Attributes["id"] != null) 
             {
                 followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(followUpConfirmationNode);
                 IDManager.SetID(followUpConfirmationIDRef_, ob);
             }
             else if (followUpConfirmationNode.Attributes["href"] != null)
             {
                 followUpConfirmationIDRef_ = followUpConfirmationNode.Attributes["href"].Value;
             }
             else
             {
                 followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
             }
         }
         else
         {
             followUpConfirmation_ = new XsdTypeBoolean(followUpConfirmationNode);
         }
     }
     
 
     XmlNode calculationAgentNode = xmlNode.SelectSingleNode("calculationAgent");
     
     if (calculationAgentNode != null)
     {
         if (calculationAgentNode.Attributes["href"] != null || calculationAgentNode.Attributes["id"] != null) 
         {
             if (calculationAgentNode.Attributes["id"] != null) 
             {
                 calculationAgentIDRef_ = calculationAgentNode.Attributes["id"].Value;
                 CalculationAgent ob = new CalculationAgent(calculationAgentNode);
                 IDManager.SetID(calculationAgentIDRef_, ob);
             }
             else if (calculationAgentNode.Attributes["href"] != null)
             {
                 calculationAgentIDRef_ = calculationAgentNode.Attributes["href"].Value;
             }
             else
             {
                 calculationAgent_ = new CalculationAgent(calculationAgentNode);
             }
         }
         else
         {
             calculationAgent_ = new CalculationAgent(calculationAgentNode);
         }
     }
     
 
     XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");
     
     if (cashSettlementNode != null)
     {
         if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) 
         {
             if (cashSettlementNode.Attributes["id"] != null) 
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                 CashSettlement ob = new CashSettlement(cashSettlementNode);
                 IDManager.SetID(cashSettlementIDRef_, ob);
             }
             else if (cashSettlementNode.Attributes["href"] != null)
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 cashSettlement_ = new CashSettlement(cashSettlementNode);
             }
         }
         else
         {
             cashSettlement_ = new CashSettlement(cashSettlementNode);
         }
     }
     
 
     XmlNode optionalEarlyTerminationAdjustedDatesNode = xmlNode.SelectSingleNode("optionalEarlyTerminationAdjustedDates");
     
     if (optionalEarlyTerminationAdjustedDatesNode != null)
     {
         if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null || optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) 
         {
             if (optionalEarlyTerminationAdjustedDatesNode.Attributes["id"] != null) 
             {
                 optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["id"].Value;
                 OptionalEarlyTerminationAdjustedDates ob = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
                 IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef_, ob);
             }
             else if (optionalEarlyTerminationAdjustedDatesNode.Attributes["href"] != null)
             {
                 optionalEarlyTerminationAdjustedDatesIDRef_ = optionalEarlyTerminationAdjustedDatesNode.Attributes["href"].Value;
             }
             else
             {
                 optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
             }
         }
         else
         {
             optionalEarlyTerminationAdjustedDates_ = new OptionalEarlyTerminationAdjustedDates(optionalEarlyTerminationAdjustedDatesNode);
         }
     }
     
 
 }
        public OptionalEarlyTermination(XmlNode xmlNode)
        {
            XmlNodeList singlePartyOptionNodeList = xmlNode.SelectNodes("singlePartyOption");

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

            foreach (XmlNode item in singlePartyOptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        singlePartyOptionIDRef = item.Attributes["id"].Name;
                        SinglePartyOption ob = SinglePartyOption();
                        IDManager.SetID(singlePartyOptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        singlePartyOptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        singlePartyOption = new SinglePartyOption(item);
                    }
                }
            }


            XmlNodeList exerciseNodeList = xmlNode.SelectNodes("exercise");

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

            foreach (XmlNode item in exerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseIDRef = item.Attributes["id"].Name;
                        Exercise ob = Exercise();
                        IDManager.SetID(exerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exercise = new Exercise(item);
                    }
                }
            }


            XmlNodeList americanExerciseNodeList = xmlNode.SelectNodes("americanExercise");

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

            foreach (XmlNode item in americanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        americanExerciseIDRef = item.Attributes["id"].Name;
                        AmericanExercise ob = AmericanExercise();
                        IDManager.SetID(americanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        americanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        americanExercise = new AmericanExercise(item);
                    }
                }
            }


            XmlNodeList bermudaExerciseNodeList = xmlNode.SelectNodes("bermudaExercise");

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

            foreach (XmlNode item in bermudaExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        bermudaExerciseIDRef = item.Attributes["id"].Name;
                        BermudaExercise ob = BermudaExercise();
                        IDManager.SetID(bermudaExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        bermudaExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        bermudaExercise = new BermudaExercise(item);
                    }
                }
            }


            XmlNodeList europeanExerciseNodeList = xmlNode.SelectNodes("europeanExercise");

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

            foreach (XmlNode item in europeanExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        europeanExerciseIDRef = item.Attributes["id"].Name;
                        EuropeanExercise ob = EuropeanExercise();
                        IDManager.SetID(europeanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        europeanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        europeanExercise = new EuropeanExercise(item);
                    }
                }
            }


            XmlNodeList exerciseNoticeNodeList = xmlNode.SelectNodes("exerciseNotice");

            foreach (XmlNode item in exerciseNoticeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseNoticeIDRef = item.Attributes["id"].Name;
                        List <ExerciseNotice> ob = new List <ExerciseNotice>();
                        ob.Add(new ExerciseNotice(item));
                        IDManager.SetID(exerciseNoticeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseNoticeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseNotice.Add(new ExerciseNotice(item));
                    }
                }
            }


            XmlNodeList followUpConfirmationNodeList = xmlNode.SelectNodes("followUpConfirmation");

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

            foreach (XmlNode item in followUpConfirmationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        followUpConfirmationIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(followUpConfirmationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        followUpConfirmationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        followUpConfirmation = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList calculationAgentNodeList = xmlNode.SelectNodes("calculationAgent");

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

            foreach (XmlNode item in calculationAgentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationAgentIDRef = item.Attributes["id"].Name;
                        CalculationAgent ob = CalculationAgent();
                        IDManager.SetID(calculationAgentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationAgentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationAgent = new CalculationAgent(item);
                    }
                }
            }


            XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");

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

            foreach (XmlNode item in cashSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashSettlementIDRef = item.Attributes["id"].Name;
                        CashSettlement ob = CashSettlement();
                        IDManager.SetID(cashSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashSettlement = new CashSettlement(item);
                    }
                }
            }


            XmlNodeList optionalEarlyTerminationAdjustedDatesNodeList = xmlNode.SelectNodes("optionalEarlyTerminationAdjustedDates");

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

            foreach (XmlNode item in optionalEarlyTerminationAdjustedDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["id"].Name;
                        OptionalEarlyTerminationAdjustedDates ob = OptionalEarlyTerminationAdjustedDates();
                        IDManager.SetID(optionalEarlyTerminationAdjustedDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionalEarlyTerminationAdjustedDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionalEarlyTerminationAdjustedDates = new OptionalEarlyTerminationAdjustedDates(item);
                    }
                }
            }
        }