public TermDeposit(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList startDateNodeList = xmlNode.SelectNodes("startDate");

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

            foreach (XmlNode item in startDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        startDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(startDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        startDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        startDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList maturityDateNodeList = xmlNode.SelectNodes("maturityDate");

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

            foreach (XmlNode item in maturityDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maturityDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(maturityDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maturityDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maturityDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList tenorNameNodeList = xmlNode.SelectNodes("tenorName");

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

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


            XmlNodeList tenorPeriodNodeList = xmlNode.SelectNodes("tenorPeriod");

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

            foreach (XmlNode item in tenorPeriodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        tenorPeriodIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(tenorPeriodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        tenorPeriodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        tenorPeriod = new Period(item);
                    }
                }
            }


            XmlNodeList principalNodeList = xmlNode.SelectNodes("principal");

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

            foreach (XmlNode item in principalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        principalIDRef = item.Attributes["id"].Name;
                        PositiveMoney ob = PositiveMoney();
                        IDManager.SetID(principalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        principalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        principal = new PositiveMoney(item);
                    }
                }
            }


            XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");

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

            foreach (XmlNode item in fixedRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedRateIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(fixedRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedRate = new PositiveDecimal(item);
                    }
                }
            }


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

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

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        DayCountFraction ob = DayCountFraction();
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction = new DayCountFraction(item);
                    }
                }
            }


            XmlNodeList featuresNodeList = xmlNode.SelectNodes("features");

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

            foreach (XmlNode item in featuresNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        featuresIDRef = item.Attributes["id"].Name;
                        TermDepositFeatures ob = TermDepositFeatures();
                        IDManager.SetID(featuresIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featuresIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        features = new TermDepositFeatures(item);
                    }
                }
            }


            XmlNodeList interestNodeList = xmlNode.SelectNodes("interest");

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

            foreach (XmlNode item in interestNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interestIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(interestIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interestIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interest = new Money(item);
                    }
                }
            }


            XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");

            foreach (XmlNode item in paymentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentIDRef = item.Attributes["id"].Name;
                        List <Payment> ob = new List <Payment>();
                        ob.Add(new Payment(item));
                        IDManager.SetID(paymentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payment.Add(new Payment(item));
                    }
                }
            }
        }
 public SimplePayment(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList paymentAmountNodeList = xmlNode.SelectNodes("paymentAmount");
     if (paymentAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(paymentAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList paymentDateNodeList = xmlNode.SelectNodes("paymentDate");
     if (paymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(paymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
 }
 public InitialPayment(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode adjustablePaymentDateNode = xmlNode.SelectSingleNode("adjustablePaymentDate");
     
     if (adjustablePaymentDateNode != null)
     {
         if (adjustablePaymentDateNode.Attributes["href"] != null || adjustablePaymentDateNode.Attributes["id"] != null) 
         {
             if (adjustablePaymentDateNode.Attributes["id"] != null) 
             {
                 adjustablePaymentDateIDRef_ = adjustablePaymentDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(adjustablePaymentDateNode);
                 IDManager.SetID(adjustablePaymentDateIDRef_, ob);
             }
             else if (adjustablePaymentDateNode.Attributes["href"] != null)
             {
                 adjustablePaymentDateIDRef_ = adjustablePaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 adjustablePaymentDate_ = new XsdTypeDate(adjustablePaymentDateNode);
             }
         }
         else
         {
             adjustablePaymentDate_ = new XsdTypeDate(adjustablePaymentDateNode);
         }
     }
     
 
     XmlNode adjustedPaymentDateNode = xmlNode.SelectSingleNode("adjustedPaymentDate");
     
     if (adjustedPaymentDateNode != null)
     {
         if (adjustedPaymentDateNode.Attributes["href"] != null || adjustedPaymentDateNode.Attributes["id"] != null) 
         {
             if (adjustedPaymentDateNode.Attributes["id"] != null) 
             {
                 adjustedPaymentDateIDRef_ = adjustedPaymentDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(adjustedPaymentDateNode);
                 IDManager.SetID(adjustedPaymentDateIDRef_, ob);
             }
             else if (adjustedPaymentDateNode.Attributes["href"] != null)
             {
                 adjustedPaymentDateIDRef_ = adjustedPaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 adjustedPaymentDate_ = new XsdTypeDate(adjustedPaymentDateNode);
             }
         }
         else
         {
             adjustedPaymentDate_ = new XsdTypeDate(adjustedPaymentDateNode);
         }
     }
     
 
     XmlNode paymentAmountNode = xmlNode.SelectSingleNode("paymentAmount");
     
     if (paymentAmountNode != null)
     {
         if (paymentAmountNode.Attributes["href"] != null || paymentAmountNode.Attributes["id"] != null) 
         {
             if (paymentAmountNode.Attributes["id"] != null) 
             {
                 paymentAmountIDRef_ = paymentAmountNode.Attributes["id"].Value;
                 Money ob = new Money(paymentAmountNode);
                 IDManager.SetID(paymentAmountIDRef_, ob);
             }
             else if (paymentAmountNode.Attributes["href"] != null)
             {
                 paymentAmountIDRef_ = paymentAmountNode.Attributes["href"].Value;
             }
             else
             {
                 paymentAmount_ = new Money(paymentAmountNode);
             }
         }
         else
         {
             paymentAmount_ = new Money(paymentAmountNode);
         }
     }
     
 
 }
 public CommoditySwaption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");
     if (optionTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionTypeIDRef = item.Attributes["id"].Name;
                 PutCallEnum ob = PutCallEnum();
                 IDManager.SetID(optionTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionType = new PutCallEnum(item);
             }
         }
     }
     
 
     XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap");
     if (commoditySwapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commoditySwapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commoditySwapIDRef = item.Attributes["id"].Name;
                 CommoditySwaptionUnderlying ob = CommoditySwaptionUnderlying();
                 IDManager.SetID(commoditySwapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commoditySwapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commoditySwap = new CommoditySwaptionUnderlying(item);
             }
         }
     }
     
 
     XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise");
     if (physicalExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalExerciseIDRef = item.Attributes["id"].Name;
                 CommodityPhysicalExercise ob = CommodityPhysicalExercise();
                 IDManager.SetID(physicalExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalExercise = new CommodityPhysicalExercise(item);
             }
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     if (premiumNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in premiumNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 premiumIDRef = item.Attributes["id"].Name;
                 CommodityPremium ob = CommodityPremium();
                 IDManager.SetID(premiumIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 premium = new CommodityPremium(item);
             }
         }
     }
     
 
     XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing");
     if (commonPricingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commonPricingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commonPricingIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(commonPricingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commonPricingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commonPricing = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption");
     if (marketDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in marketDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 marketDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityMarketDisruption ob = CommodityMarketDisruption();
                 IDManager.SetID(marketDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 marketDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 marketDisruption = new CommodityMarketDisruption(item);
             }
         }
     }
     
 
     XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption");
     if (settlementDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum();
                 IDManager.SetID(settlementDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item);
             }
         }
     }
     
 
     XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding");
     if (roundingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in roundingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 roundingIDRef = item.Attributes["id"].Name;
                 Rounding ob = Rounding();
                 IDManager.SetID(roundingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 roundingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 rounding = new Rounding(item);
             }
         }
     }
     
 
 }
 public PhysicalForwardLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
 }
        public InitialPayment(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


            XmlNode adjustablePaymentDateNode = xmlNode.SelectSingleNode("adjustablePaymentDate");

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


            XmlNode adjustedPaymentDateNode = xmlNode.SelectSingleNode("adjustedPaymentDate");

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


            XmlNode paymentAmountNode = xmlNode.SelectSingleNode("paymentAmount");

            if (paymentAmountNode != null)
            {
                if (paymentAmountNode.Attributes["href"] != null || paymentAmountNode.Attributes["id"] != null)
                {
                    if (paymentAmountNode.Attributes["id"] != null)
                    {
                        paymentAmountIDRef_ = paymentAmountNode.Attributes["id"].Value;
                        Money ob = new Money(paymentAmountNode);
                        IDManager.SetID(paymentAmountIDRef_, ob);
                    }
                    else if (paymentAmountNode.Attributes["href"] != null)
                    {
                        paymentAmountIDRef_ = paymentAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentAmount_ = new Money(paymentAmountNode);
                    }
                }
                else
                {
                    paymentAmount_ = new Money(paymentAmountNode);
                }
            }
        }
 public CommodityOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");
     if (optionTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionTypeIDRef = item.Attributes["id"].Name;
                 PutCallEnum ob = PutCallEnum();
                 IDManager.SetID(optionTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionType = new PutCallEnum(item);
             }
         }
     }
     
 
     XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");
     if (commodityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityIDRef = item.Attributes["id"].Name;
                 Commodity ob = Commodity();
                 IDManager.SetID(commodityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodity = new Commodity(item);
             }
         }
     }
     
 
     XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");
     if (effectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in effectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 effectiveDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(effectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 effectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 effectiveDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate");
     if (terminationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationDateIDRef = item.Attributes["id"].Name;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(terminationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminationDate = new AdjustableOrRelativeDate(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");
     if (calculationPeriodsScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["id"].Name;
                 CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                 IDManager.SetID(calculationPeriodsScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item);
             }
         }
     }
     
 
     XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");
     if (calculationPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationPeriodsIDRef = item.Attributes["id"].Name;
                 AdjustableDates ob = AdjustableDates();
                 IDManager.SetID(calculationPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationPeriods = new AdjustableDates(item);
             }
         }
     }
     
 
     XmlNodeList pricingDatesNodeList = xmlNode.SelectNodes("pricingDates");
     if (pricingDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in pricingDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricingDatesIDRef = item.Attributes["id"].Name;
                 CommodityPricingDates ob = CommodityPricingDates();
                 IDManager.SetID(pricingDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricingDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 pricingDates = new CommodityPricingDates(item);
             }
         }
     }
     
 
     XmlNodeList averagingMethodNodeList = xmlNode.SelectNodes("averagingMethod");
     if (averagingMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in averagingMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 averagingMethodIDRef = item.Attributes["id"].Name;
                 AveragingMethodEnum ob = AveragingMethodEnum();
                 IDManager.SetID(averagingMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 averagingMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 averagingMethod = new AveragingMethodEnum(item);
             }
         }
     }
     
 
     XmlNodeList notionalQuantityScheduleNodeList = xmlNode.SelectNodes("notionalQuantitySchedule");
     if (notionalQuantityScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalQuantityScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalQuantityScheduleIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantitySchedule ob = CommodityNotionalQuantitySchedule();
                 IDManager.SetID(notionalQuantityScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalQuantityScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalQuantitySchedule = new CommodityNotionalQuantitySchedule(item);
             }
         }
     }
     
 
     XmlNodeList notionalQuantityNodeList = xmlNode.SelectNodes("notionalQuantity");
     if (notionalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalQuantityIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                 IDManager.SetID(notionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalQuantity = new CommodityNotionalQuantity(item);
             }
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity");
     
     foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementPeriodsNotionalQuantityIDRef = item.Attributes["id"].Name;
                 List<CommoditySettlementPeriodsNotionalQuantity> ob = new List<CommoditySettlementPeriodsNotionalQuantity>();
                 ob.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                 IDManager.SetID(settlementPeriodsNotionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementPeriodsNotionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
             settlementPeriodsNotionalQuantity.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNodeList totalNotionalQuantityNodeList = xmlNode.SelectNodes("totalNotionalQuantity");
     if (totalNotionalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in totalNotionalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 totalNotionalQuantityIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(totalNotionalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 totalNotionalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 totalNotionalQuantity = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");
     if (quantityReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in quantityReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quantityReferenceIDRef = item.Attributes["id"].Name;
                 QuantityReference ob = QuantityReference();
                 IDManager.SetID(quantityReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quantityReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 quantityReference = new QuantityReference(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;
                 CommodityExercise ob = CommodityExercise();
                 IDManager.SetID(exerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exercise = new CommodityExercise(item);
             }
         }
     }
     
 
     XmlNodeList strikePricePerUnitNodeList = xmlNode.SelectNodes("strikePricePerUnit");
     if (strikePricePerUnitNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strikePricePerUnitNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strikePricePerUnitIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(strikePricePerUnitIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strikePricePerUnitIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strikePricePerUnit = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList strikePricePerUnitScheduleNodeList = xmlNode.SelectNodes("strikePricePerUnitSchedule");
     if (strikePricePerUnitScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strikePricePerUnitScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strikePricePerUnitScheduleIDRef = item.Attributes["id"].Name;
                 CommodityStrikeSchedule ob = CommodityStrikeSchedule();
                 IDManager.SetID(strikePricePerUnitScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strikePricePerUnitScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strikePricePerUnitSchedule = new CommodityStrikeSchedule(item);
             }
         }
     }
     
 
     XmlNodeList floatingStrikePricePerUnitNodeList = xmlNode.SelectNodes("floatingStrikePricePerUnit");
     if (floatingStrikePricePerUnitNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingStrikePricePerUnitNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitIDRef = item.Attributes["id"].Name;
                 FloatingStrikePrice ob = FloatingStrikePrice();
                 IDManager.SetID(floatingStrikePricePerUnitIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingStrikePricePerUnitIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingStrikePricePerUnit = new FloatingStrikePrice(item);
             }
         }
     }
     
 
     XmlNodeList floatingStrikePricePerUnitScheduleNodeList = xmlNode.SelectNodes("floatingStrikePricePerUnitSchedule");
     if (floatingStrikePricePerUnitScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingStrikePricePerUnitScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitScheduleIDRef = item.Attributes["id"].Name;
                 CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                 IDManager.SetID(floatingStrikePricePerUnitScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingStrikePricePerUnitScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingStrikePricePerUnitSchedule = new CommodityCalculationPeriodsSchedule(item);
             }
         }
     }
     
 
     XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap");
     if (commoditySwapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commoditySwapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commoditySwapIDRef = item.Attributes["id"].Name;
                 CommoditySwap ob = CommoditySwap();
                 IDManager.SetID(commoditySwapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commoditySwapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commoditySwap = new CommoditySwap(item);
             }
         }
     }
     
 
     XmlNodeList commodityForwardNodeList = xmlNode.SelectNodes("commodityForward");
     if (commodityForwardNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityForwardNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityForwardIDRef = item.Attributes["id"].Name;
                 CommodityForward ob = CommodityForward();
                 IDManager.SetID(commodityForwardIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityForwardIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodityForward = new CommodityForward(item);
             }
         }
     }
     
 
     XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise");
     if (physicalExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalExerciseIDRef = item.Attributes["id"].Name;
                 CommodityPhysicalExercise ob = CommodityPhysicalExercise();
                 IDManager.SetID(physicalExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalExercise = new CommodityPhysicalExercise(item);
             }
         }
     }
     
 
     XmlNodeList weatherCalculationPeriodsNodeList = xmlNode.SelectNodes("weatherCalculationPeriods");
     if (weatherCalculationPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherCalculationPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsIDRef = item.Attributes["id"].Name;
                 WeatherCalculationPeriods ob = WeatherCalculationPeriods();
                 IDManager.SetID(weatherCalculationPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherCalculationPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherCalculationPeriods = new WeatherCalculationPeriods(item);
             }
         }
     }
     
 
     XmlNodeList weatherCalculationPeriodsReferenceNodeList = xmlNode.SelectNodes("weatherCalculationPeriodsReference");
     if (weatherCalculationPeriodsReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherCalculationPeriodsReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsReferenceIDRef = item.Attributes["id"].Name;
                 CalculationPeriodsReference ob = CalculationPeriodsReference();
                 IDManager.SetID(weatherCalculationPeriodsReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherCalculationPeriodsReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherCalculationPeriodsReference = new CalculationPeriodsReference(item);
             }
         }
     }
     
 
     XmlNodeList weatherNotionalAmountNodeList = xmlNode.SelectNodes("weatherNotionalAmount");
     if (weatherNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherNotionalAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(weatherNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherNotionalAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList weatherIndexStrikeLevelNodeList = xmlNode.SelectNodes("weatherIndexStrikeLevel");
     if (weatherIndexStrikeLevelNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherIndexStrikeLevelNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherIndexStrikeLevelIDRef = item.Attributes["id"].Name;
                 WeatherIndex ob = WeatherIndex();
                 IDManager.SetID(weatherIndexStrikeLevelIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherIndexStrikeLevelIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherIndexStrikeLevel = new WeatherIndex(item);
             }
         }
     }
     
 
     XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation");
     if (calculationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationIDRef = item.Attributes["id"].Name;
                 WeatherLegCalculation ob = WeatherLegCalculation();
                 IDManager.SetID(calculationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculation = new WeatherLegCalculation(item);
             }
         }
     }
     
 
     XmlNodeList weatherIndexDataNodeList = xmlNode.SelectNodes("weatherIndexData");
     if (weatherIndexDataNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherIndexDataNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherIndexDataIDRef = item.Attributes["id"].Name;
                 WeatherIndexData ob = WeatherIndexData();
                 IDManager.SetID(weatherIndexDataIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherIndexDataIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherIndexData = new WeatherIndexData(item);
             }
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     
     foreach (XmlNode item in premiumNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 premiumIDRef = item.Attributes["id"].Name;
                 List<CommodityPremium> ob = new List<CommodityPremium>();
                 ob.Add(new CommodityPremium(item));
                 IDManager.SetID(premiumIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumIDRef = item.Attributes["href"].Name;
             }
             else
             {
             premium.Add(new CommodityPremium(item));
             }
         }
     }
     
 
     XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing");
     if (commonPricingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commonPricingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commonPricingIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(commonPricingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commonPricingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commonPricing = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption");
     if (marketDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in marketDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 marketDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityMarketDisruption ob = CommodityMarketDisruption();
                 IDManager.SetID(marketDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 marketDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 marketDisruption = new CommodityMarketDisruption(item);
             }
         }
     }
     
 
     XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption");
     if (settlementDisruptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementDisruptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementDisruptionIDRef = item.Attributes["id"].Name;
                 CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum();
                 IDManager.SetID(settlementDisruptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementDisruptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item);
             }
         }
     }
     
 
     XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding");
     if (roundingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in roundingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 roundingIDRef = item.Attributes["id"].Name;
                 Rounding ob = Rounding();
                 IDManager.SetID(roundingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 roundingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 rounding = new Rounding(item);
             }
         }
     }
     
 
 }
Example #8
0
        public CommoditySwaption(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");

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

            foreach (XmlNode item in optionTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionTypeIDRef = item.Attributes["id"].Name;
                        PutCallEnum ob = PutCallEnum();
                        IDManager.SetID(optionTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionType = new PutCallEnum(item);
                    }
                }
            }


            XmlNodeList commoditySwapNodeList = xmlNode.SelectNodes("commoditySwap");

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

            foreach (XmlNode item in commoditySwapNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commoditySwapIDRef = item.Attributes["id"].Name;
                        CommoditySwaptionUnderlying ob = CommoditySwaptionUnderlying();
                        IDManager.SetID(commoditySwapIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commoditySwapIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commoditySwap = new CommoditySwaptionUnderlying(item);
                    }
                }
            }


            XmlNodeList physicalExerciseNodeList = xmlNode.SelectNodes("physicalExercise");

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

            foreach (XmlNode item in physicalExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalExerciseIDRef = item.Attributes["id"].Name;
                        CommodityPhysicalExercise ob = CommodityPhysicalExercise();
                        IDManager.SetID(physicalExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalExercise = new CommodityPhysicalExercise(item);
                    }
                }
            }


            XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");

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

            foreach (XmlNode item in premiumNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        premiumIDRef = item.Attributes["id"].Name;
                        CommodityPremium ob = CommodityPremium();
                        IDManager.SetID(premiumIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premium = new CommodityPremium(item);
                    }
                }
            }


            XmlNodeList commonPricingNodeList = xmlNode.SelectNodes("commonPricing");

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

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


            XmlNodeList marketDisruptionNodeList = xmlNode.SelectNodes("marketDisruption");

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

            foreach (XmlNode item in marketDisruptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        marketDisruptionIDRef = item.Attributes["id"].Name;
                        CommodityMarketDisruption ob = CommodityMarketDisruption();
                        IDManager.SetID(marketDisruptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        marketDisruptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        marketDisruption = new CommodityMarketDisruption(item);
                    }
                }
            }


            XmlNodeList settlementDisruptionNodeList = xmlNode.SelectNodes("settlementDisruption");

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

            foreach (XmlNode item in settlementDisruptionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementDisruptionIDRef = item.Attributes["id"].Name;
                        CommodityBullionSettlementDisruptionEnum ob = CommodityBullionSettlementDisruptionEnum();
                        IDManager.SetID(settlementDisruptionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementDisruptionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementDisruption = new CommodityBullionSettlementDisruptionEnum(item);
                    }
                }
            }


            XmlNodeList roundingNodeList = xmlNode.SelectNodes("rounding");

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

            foreach (XmlNode item in roundingNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        roundingIDRef = item.Attributes["id"].Name;
                        Rounding ob = Rounding();
                        IDManager.SetID(roundingIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        roundingIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        rounding = new Rounding(item);
                    }
                }
            }
        }
 public PassThroughItem(XmlNode xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode underlyerReferenceNode = xmlNode.SelectSingleNode("underlyerReference");
     
     if (underlyerReferenceNode != null)
     {
         if (underlyerReferenceNode.Attributes["href"] != null || underlyerReferenceNode.Attributes["id"] != null) 
         {
             if (underlyerReferenceNode.Attributes["id"] != null) 
             {
                 underlyerReferenceIDRef_ = underlyerReferenceNode.Attributes["id"].Value;
                 AssetReference ob = new AssetReference(underlyerReferenceNode);
                 IDManager.SetID(underlyerReferenceIDRef_, ob);
             }
             else if (underlyerReferenceNode.Attributes["href"] != null)
             {
                 underlyerReferenceIDRef_ = underlyerReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 underlyerReference_ = new AssetReference(underlyerReferenceNode);
             }
         }
         else
         {
             underlyerReference_ = new AssetReference(underlyerReferenceNode);
         }
     }
     
 
     XmlNode passThroughPercentageNode = xmlNode.SelectSingleNode("passThroughPercentage");
     
     if (passThroughPercentageNode != null)
     {
         if (passThroughPercentageNode.Attributes["href"] != null || passThroughPercentageNode.Attributes["id"] != null) 
         {
             if (passThroughPercentageNode.Attributes["id"] != null) 
             {
                 passThroughPercentageIDRef_ = passThroughPercentageNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(passThroughPercentageNode);
                 IDManager.SetID(passThroughPercentageIDRef_, ob);
             }
             else if (passThroughPercentageNode.Attributes["href"] != null)
             {
                 passThroughPercentageIDRef_ = passThroughPercentageNode.Attributes["href"].Value;
             }
             else
             {
                 passThroughPercentage_ = new XsdTypeDecimal(passThroughPercentageNode);
             }
         }
         else
         {
             passThroughPercentage_ = new XsdTypeDecimal(passThroughPercentageNode);
         }
     }
     
 
 }
        public PrePayment(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList prePaymentNodeList = xmlNode.SelectNodes("prePayment");

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

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


            XmlNodeList prePaymentAmountNodeList = xmlNode.SelectNodes("prePaymentAmount");

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

            foreach (XmlNode item in prePaymentAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        prePaymentAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(prePaymentAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        prePaymentAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        prePaymentAmount = new NonNegativeMoney(item);
                    }
                }
            }


            XmlNodeList prePaymentDateNodeList = xmlNode.SelectNodes("prePaymentDate");

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

            foreach (XmlNode item in prePaymentDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        prePaymentDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate ob = AdjustableDate();
                        IDManager.SetID(prePaymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        prePaymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        prePaymentDate = new AdjustableDate(item);
                    }
                }
            }
        }
        public GenericProduct(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList multiLegNodeList = xmlNode.SelectNodes("multiLeg");

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

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


            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference");

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


            XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");

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

            foreach (XmlNode item in premiumNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        premiumIDRef = item.Attributes["id"].Name;
                        SimplePayment ob = SimplePayment();
                        IDManager.SetID(premiumIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premium = new SimplePayment(item);
                    }
                }
            }


            XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");

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

            foreach (XmlNode item in effectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        effectiveDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate2 ob = AdjustableDate2();
                        IDManager.SetID(effectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        effectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        effectiveDate = new AdjustableDate2(item);
                    }
                }
            }


            XmlNodeList expirationDateNodeList = xmlNode.SelectNodes("expirationDate");

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

            foreach (XmlNode item in expirationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        expirationDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate2 ob = AdjustableDate2();
                        IDManager.SetID(expirationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        expirationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        expirationDate = new AdjustableDate2(item);
                    }
                }
            }


            XmlNodeList terminationDateNodeList = xmlNode.SelectNodes("terminationDate");

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

            foreach (XmlNode item in terminationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminationDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate2 ob = AdjustableDate2();
                        IDManager.SetID(terminationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        terminationDate = new AdjustableDate2(item);
                    }
                }
            }


            XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");

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


            XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");

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


            XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");

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

            foreach (XmlNode item in optionTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionTypeIDRef = item.Attributes["id"].Name;
                        OptionType ob = OptionType();
                        IDManager.SetID(optionTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionType = new OptionType(item);
                    }
                }
            }


            XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");

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


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

            foreach (XmlNode item in dayCountFractionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dayCountFractionIDRef = item.Attributes["id"].Name;
                        List <DayCountFraction> ob = new List <DayCountFraction>();
                        ob.Add(new DayCountFraction(item));
                        IDManager.SetID(dayCountFractionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dayCountFractionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dayCountFraction.Add(new DayCountFraction(item));
                    }
                }
            }
        }
Example #12
0
        public FeaturePayment(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


            XmlNode levelPercentageNode = xmlNode.SelectSingleNode("levelPercentage");

            if (levelPercentageNode != null)
            {
                if (levelPercentageNode.Attributes["href"] != null || levelPercentageNode.Attributes["id"] != null)
                {
                    if (levelPercentageNode.Attributes["id"] != null)
                    {
                        levelPercentageIDRef_ = levelPercentageNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(levelPercentageNode);
                        IDManager.SetID(levelPercentageIDRef_, ob);
                    }
                    else if (levelPercentageNode.Attributes["href"] != null)
                    {
                        levelPercentageIDRef_ = levelPercentageNode.Attributes["href"].Value;
                    }
                    else
                    {
                        levelPercentage_ = new XsdTypeDecimal(levelPercentageNode);
                    }
                }
                else
                {
                    levelPercentage_ = new XsdTypeDecimal(levelPercentageNode);
                }
            }


            XmlNode amountNode = xmlNode.SelectSingleNode("amount");

            if (amountNode != null)
            {
                if (amountNode.Attributes["href"] != null || amountNode.Attributes["id"] != null)
                {
                    if (amountNode.Attributes["id"] != null)
                    {
                        amountIDRef_ = amountNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(amountNode);
                        IDManager.SetID(amountIDRef_, ob);
                    }
                    else if (amountNode.Attributes["href"] != null)
                    {
                        amountIDRef_ = amountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        amount_ = new NonNegativeDecimal(amountNode);
                    }
                }
                else
                {
                    amount_ = new NonNegativeDecimal(amountNode);
                }
            }


            XmlNode timeNode = xmlNode.SelectSingleNode("time");

            if (timeNode != null)
            {
                if (timeNode.Attributes["href"] != null || timeNode.Attributes["id"] != null)
                {
                    if (timeNode.Attributes["id"] != null)
                    {
                        timeIDRef_ = timeNode.Attributes["id"].Value;
                        TimeTypeEnum ob = new TimeTypeEnum(timeNode);
                        IDManager.SetID(timeIDRef_, ob);
                    }
                    else if (timeNode.Attributes["href"] != null)
                    {
                        timeIDRef_ = timeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        time_ = new TimeTypeEnum(timeNode);
                    }
                }
                else
                {
                    time_ = new TimeTypeEnum(timeNode);
                }
            }


            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

            if (currencyNode != null)
            {
                if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null)
                {
                    if (currencyNode.Attributes["id"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["id"].Value;
                        Currency ob = new Currency(currencyNode);
                        IDManager.SetID(currencyIDRef_, ob);
                    }
                    else if (currencyNode.Attributes["href"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currency_ = new Currency(currencyNode);
                    }
                }
                else
                {
                    currency_ = new Currency(currencyNode);
                }
            }


            XmlNode featurePaymentDateNode = xmlNode.SelectSingleNode("featurePaymentDate");

            if (featurePaymentDateNode != null)
            {
                if (featurePaymentDateNode.Attributes["href"] != null || featurePaymentDateNode.Attributes["id"] != null)
                {
                    if (featurePaymentDateNode.Attributes["id"] != null)
                    {
                        featurePaymentDateIDRef_ = featurePaymentDateNode.Attributes["id"].Value;
                        AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(featurePaymentDateNode);
                        IDManager.SetID(featurePaymentDateIDRef_, ob);
                    }
                    else if (featurePaymentDateNode.Attributes["href"] != null)
                    {
                        featurePaymentDateIDRef_ = featurePaymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        featurePaymentDate_ = new AdjustableOrRelativeDate(featurePaymentDateNode);
                    }
                }
                else
                {
                    featurePaymentDate_ = new AdjustableOrRelativeDate(featurePaymentDateNode);
                }
            }
        }
        public Payment(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


            XmlNode paymentAmountNode = xmlNode.SelectSingleNode("paymentAmount");

            if (paymentAmountNode != null)
            {
                if (paymentAmountNode.Attributes["href"] != null || paymentAmountNode.Attributes["id"] != null)
                {
                    if (paymentAmountNode.Attributes["id"] != null)
                    {
                        paymentAmountIDRef_ = paymentAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(paymentAmountNode);
                        IDManager.SetID(paymentAmountIDRef_, ob);
                    }
                    else if (paymentAmountNode.Attributes["href"] != null)
                    {
                        paymentAmountIDRef_ = paymentAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentAmount_ = new NonNegativeMoney(paymentAmountNode);
                    }
                }
                else
                {
                    paymentAmount_ = new NonNegativeMoney(paymentAmountNode);
                }
            }


            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;
                        AdjustableOrAdjustedDate ob = new AdjustableOrAdjustedDate(paymentDateNode);
                        IDManager.SetID(paymentDateIDRef_, ob);
                    }
                    else if (paymentDateNode.Attributes["href"] != null)
                    {
                        paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDate_ = new AdjustableOrAdjustedDate(paymentDateNode);
                    }
                }
                else
                {
                    paymentDate_ = new AdjustableOrAdjustedDate(paymentDateNode);
                }
            }


            XmlNode paymentTypeNode = xmlNode.SelectSingleNode("paymentType");

            if (paymentTypeNode != null)
            {
                if (paymentTypeNode.Attributes["href"] != null || paymentTypeNode.Attributes["id"] != null)
                {
                    if (paymentTypeNode.Attributes["id"] != null)
                    {
                        paymentTypeIDRef_ = paymentTypeNode.Attributes["id"].Value;
                        PaymentType ob = new PaymentType(paymentTypeNode);
                        IDManager.SetID(paymentTypeIDRef_, ob);
                    }
                    else if (paymentTypeNode.Attributes["href"] != null)
                    {
                        paymentTypeIDRef_ = paymentTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentType_ = new PaymentType(paymentTypeNode);
                    }
                }
                else
                {
                    paymentType_ = new PaymentType(paymentTypeNode);
                }
            }


            XmlNode settlementInformationNode = xmlNode.SelectSingleNode("settlementInformation");

            if (settlementInformationNode != null)
            {
                if (settlementInformationNode.Attributes["href"] != null || settlementInformationNode.Attributes["id"] != null)
                {
                    if (settlementInformationNode.Attributes["id"] != null)
                    {
                        settlementInformationIDRef_ = settlementInformationNode.Attributes["id"].Value;
                        SettlementInformation ob = new SettlementInformation(settlementInformationNode);
                        IDManager.SetID(settlementInformationIDRef_, ob);
                    }
                    else if (settlementInformationNode.Attributes["href"] != null)
                    {
                        settlementInformationIDRef_ = settlementInformationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementInformation_ = new SettlementInformation(settlementInformationNode);
                    }
                }
                else
                {
                    settlementInformation_ = new SettlementInformation(settlementInformationNode);
                }
            }


            XmlNode discountFactorNode = xmlNode.SelectSingleNode("discountFactor");

            if (discountFactorNode != null)
            {
                if (discountFactorNode.Attributes["href"] != null || discountFactorNode.Attributes["id"] != null)
                {
                    if (discountFactorNode.Attributes["id"] != null)
                    {
                        discountFactorIDRef_ = discountFactorNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(discountFactorNode);
                        IDManager.SetID(discountFactorIDRef_, ob);
                    }
                    else if (discountFactorNode.Attributes["href"] != null)
                    {
                        discountFactorIDRef_ = discountFactorNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discountFactor_ = new XsdTypeDecimal(discountFactorNode);
                    }
                }
                else
                {
                    discountFactor_ = new XsdTypeDecimal(discountFactorNode);
                }
            }


            XmlNode presentValueAmountNode = xmlNode.SelectSingleNode("presentValueAmount");

            if (presentValueAmountNode != null)
            {
                if (presentValueAmountNode.Attributes["href"] != null || presentValueAmountNode.Attributes["id"] != null)
                {
                    if (presentValueAmountNode.Attributes["id"] != null)
                    {
                        presentValueAmountIDRef_ = presentValueAmountNode.Attributes["id"].Value;
                        Money ob = new Money(presentValueAmountNode);
                        IDManager.SetID(presentValueAmountIDRef_, ob);
                    }
                    else if (presentValueAmountNode.Attributes["href"] != null)
                    {
                        presentValueAmountIDRef_ = presentValueAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        presentValueAmount_ = new Money(presentValueAmountNode);
                    }
                }
                else
                {
                    presentValueAmount_ = new Money(presentValueAmountNode);
                }
            }
        }
        public CommoditySwaption(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");

            if (buyerPartyReferenceNode != null)
            {
                if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (buyerPartyReferenceNode.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                        IDManager.SetID(buyerPartyReferenceIDRef_, ob);
                    }
                    else if (buyerPartyReferenceNode.Attributes["href"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                    }
                }
                else
                {
                    buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                }
            }


            XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");

            if (buyerAccountReferenceNode != null)
            {
                if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (buyerAccountReferenceNode.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                        IDManager.SetID(buyerAccountReferenceIDRef_, ob);
                    }
                    else if (buyerAccountReferenceNode.Attributes["href"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                    }
                }
                else
                {
                    buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                }
            }


            XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");

            if (sellerPartyReferenceNode != null)
            {
                if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (sellerPartyReferenceNode.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                        IDManager.SetID(sellerPartyReferenceIDRef_, ob);
                    }
                    else if (sellerPartyReferenceNode.Attributes["href"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                    }
                }
                else
                {
                    sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                }
            }


            XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");

            if (sellerAccountReferenceNode != null)
            {
                if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (sellerAccountReferenceNode.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                        IDManager.SetID(sellerAccountReferenceIDRef_, ob);
                    }
                    else if (sellerAccountReferenceNode.Attributes["href"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                    }
                }
                else
                {
                    sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                }
            }


            XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType");

            if (optionTypeNode != null)
            {
                if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null)
                {
                    if (optionTypeNode.Attributes["id"] != null)
                    {
                        optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value;
                        PutCallEnum ob = new PutCallEnum(optionTypeNode);
                        IDManager.SetID(optionTypeIDRef_, ob);
                    }
                    else if (optionTypeNode.Attributes["href"] != null)
                    {
                        optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionType_ = new PutCallEnum(optionTypeNode);
                    }
                }
                else
                {
                    optionType_ = new PutCallEnum(optionTypeNode);
                }
            }


            XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap");

            if (commoditySwapNode != null)
            {
                if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null)
                {
                    if (commoditySwapNode.Attributes["id"] != null)
                    {
                        commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value;
                        CommoditySwaptionUnderlying ob = new CommoditySwaptionUnderlying(commoditySwapNode);
                        IDManager.SetID(commoditySwapIDRef_, ob);
                    }
                    else if (commoditySwapNode.Attributes["href"] != null)
                    {
                        commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value;
                    }
                    else
                    {
                        commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode);
                    }
                }
                else
                {
                    commoditySwap_ = new CommoditySwaptionUnderlying(commoditySwapNode);
                }
            }


            XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise");

            if (physicalExerciseNode != null)
            {
                if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null)
                {
                    if (physicalExerciseNode.Attributes["id"] != null)
                    {
                        physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value;
                        CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode);
                        IDManager.SetID(physicalExerciseIDRef_, ob);
                    }
                    else if (physicalExerciseNode.Attributes["href"] != null)
                    {
                        physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
                    }
                }
                else
                {
                    physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
                }
            }


            XmlNode premiumNode = xmlNode.SelectSingleNode("premium");

            if (premiumNode != null)
            {
                if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null)
                {
                    if (premiumNode.Attributes["id"] != null)
                    {
                        premiumIDRef_ = premiumNode.Attributes["id"].Value;
                        CommodityPremium ob = new CommodityPremium(premiumNode);
                        IDManager.SetID(premiumIDRef_, ob);
                    }
                    else if (premiumNode.Attributes["href"] != null)
                    {
                        premiumIDRef_ = premiumNode.Attributes["href"].Value;
                    }
                    else
                    {
                        premium_ = new CommodityPremium(premiumNode);
                    }
                }
                else
                {
                    premium_ = new CommodityPremium(premiumNode);
                }
            }


            XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing");

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


            XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption");

            if (marketDisruptionNode != null)
            {
                if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null)
                {
                    if (marketDisruptionNode.Attributes["id"] != null)
                    {
                        marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value;
                        CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode);
                        IDManager.SetID(marketDisruptionIDRef_, ob);
                    }
                    else if (marketDisruptionNode.Attributes["href"] != null)
                    {
                        marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
                    }
                }
                else
                {
                    marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
                }
            }


            XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption");

            if (settlementDisruptionNode != null)
            {
                if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null)
                {
                    if (settlementDisruptionNode.Attributes["id"] != null)
                    {
                        settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value;
                        CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                        IDManager.SetID(settlementDisruptionIDRef_, ob);
                    }
                    else if (settlementDisruptionNode.Attributes["href"] != null)
                    {
                        settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                    }
                }
                else
                {
                    settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                }
            }


            XmlNode roundingNode = xmlNode.SelectSingleNode("rounding");

            if (roundingNode != null)
            {
                if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null)
                {
                    if (roundingNode.Attributes["id"] != null)
                    {
                        roundingIDRef_ = roundingNode.Attributes["id"].Value;
                        Rounding ob = new Rounding(roundingNode);
                        IDManager.SetID(roundingIDRef_, ob);
                    }
                    else if (roundingNode.Attributes["href"] != null)
                    {
                        roundingIDRef_ = roundingNode.Attributes["href"].Value;
                    }
                    else
                    {
                        rounding_ = new Rounding(roundingNode);
                    }
                }
                else
                {
                    rounding_ = new Rounding(roundingNode);
                }
            }
        }
        public PrincipalExchangeDescriptions(XmlNode xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList principalExchangeAmountNodeList = xmlNode.SelectNodes("principalExchangeAmount");

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

            foreach (XmlNode item in principalExchangeAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        principalExchangeAmountIDRef = item.Attributes["id"].Name;
                        PrincipalExchangeAmount ob = PrincipalExchangeAmount();
                        IDManager.SetID(principalExchangeAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        principalExchangeAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        principalExchangeAmount = new PrincipalExchangeAmount(item);
                    }
                }
            }


            XmlNodeList principalExchangeDateNodeList = xmlNode.SelectNodes("principalExchangeDate");

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

            foreach (XmlNode item in principalExchangeDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        principalExchangeDateIDRef = item.Attributes["id"].Name;
                        AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                        IDManager.SetID(principalExchangeDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        principalExchangeDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        principalExchangeDate = new AdjustableOrRelativeDate(item);
                    }
                }
            }
        }
Example #16
0
        public GrossCashflow(XmlNode xmlNode)
        {
            XmlNode cashflowIdNode = xmlNode.SelectSingleNode("cashflowId");

            if (cashflowIdNode != null)
            {
                if (cashflowIdNode.Attributes["href"] != null || cashflowIdNode.Attributes["id"] != null)
                {
                    if (cashflowIdNode.Attributes["id"] != null)
                    {
                        cashflowIdIDRef_ = cashflowIdNode.Attributes["id"].Value;
                        CashflowId ob = new CashflowId(cashflowIdNode);
                        IDManager.SetID(cashflowIdIDRef_, ob);
                    }
                    else if (cashflowIdNode.Attributes["href"] != null)
                    {
                        cashflowIdIDRef_ = cashflowIdNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashflowId_ = new CashflowId(cashflowIdNode);
                    }
                }
                else
                {
                    cashflowId_ = new CashflowId(cashflowIdNode);
                }
            }


            XmlNode partyTradeIdentifierReferenceNode = xmlNode.SelectSingleNode("partyTradeIdentifierReference");

            if (partyTradeIdentifierReferenceNode != null)
            {
                if (partyTradeIdentifierReferenceNode.Attributes["href"] != null || partyTradeIdentifierReferenceNode.Attributes["id"] != null)
                {
                    if (partyTradeIdentifierReferenceNode.Attributes["id"] != null)
                    {
                        partyTradeIdentifierReferenceIDRef_ = partyTradeIdentifierReferenceNode.Attributes["id"].Value;
                        PartyTradeIdentifierReference ob = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
                        IDManager.SetID(partyTradeIdentifierReferenceIDRef_, ob);
                    }
                    else if (partyTradeIdentifierReferenceNode.Attributes["href"] != null)
                    {
                        partyTradeIdentifierReferenceIDRef_ = partyTradeIdentifierReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        partyTradeIdentifierReference_ = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
                    }
                }
                else
                {
                    partyTradeIdentifierReference_ = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
                }
            }


            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


            XmlNode cashflowAmountNode = xmlNode.SelectSingleNode("cashflowAmount");

            if (cashflowAmountNode != null)
            {
                if (cashflowAmountNode.Attributes["href"] != null || cashflowAmountNode.Attributes["id"] != null)
                {
                    if (cashflowAmountNode.Attributes["id"] != null)
                    {
                        cashflowAmountIDRef_ = cashflowAmountNode.Attributes["id"].Value;
                        Money ob = new Money(cashflowAmountNode);
                        IDManager.SetID(cashflowAmountIDRef_, ob);
                    }
                    else if (cashflowAmountNode.Attributes["href"] != null)
                    {
                        cashflowAmountIDRef_ = cashflowAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashflowAmount_ = new Money(cashflowAmountNode);
                    }
                }
                else
                {
                    cashflowAmount_ = new Money(cashflowAmountNode);
                }
            }


            XmlNode cashflowTypeNode = xmlNode.SelectSingleNode("cashflowType");

            if (cashflowTypeNode != null)
            {
                if (cashflowTypeNode.Attributes["href"] != null || cashflowTypeNode.Attributes["id"] != null)
                {
                    if (cashflowTypeNode.Attributes["id"] != null)
                    {
                        cashflowTypeIDRef_ = cashflowTypeNode.Attributes["id"].Value;
                        CashflowType ob = new CashflowType(cashflowTypeNode);
                        IDManager.SetID(cashflowTypeIDRef_, ob);
                    }
                    else if (cashflowTypeNode.Attributes["href"] != null)
                    {
                        cashflowTypeIDRef_ = cashflowTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashflowType_ = new CashflowType(cashflowTypeNode);
                    }
                }
                else
                {
                    cashflowType_ = new CashflowType(cashflowTypeNode);
                }
            }
        }
 public IndependentAmount(XmlNode xmlNode)
 {
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList paymentDetailNodeList = xmlNode.SelectNodes("paymentDetail");
     
     foreach (XmlNode item in paymentDetailNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDetailIDRef = item.Attributes["id"].Name;
                 List<PaymentDetail> ob = new List<PaymentDetail>();
                 ob.Add(new PaymentDetail(item));
                 IDManager.SetID(paymentDetailIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDetailIDRef = item.Attributes["href"].Name;
             }
             else
             {
             paymentDetail.Add(new PaymentDetail(item));
             }
         }
     }
     
 
 }
        public InterestRateStream(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }


            XmlNode calculationPeriodDatesNode = xmlNode.SelectSingleNode("calculationPeriodDates");

            if (calculationPeriodDatesNode != null)
            {
                if (calculationPeriodDatesNode.Attributes["href"] != null || calculationPeriodDatesNode.Attributes["id"] != null)
                {
                    if (calculationPeriodDatesNode.Attributes["id"] != null)
                    {
                        calculationPeriodDatesIDRef_ = calculationPeriodDatesNode.Attributes["id"].Value;
                        CalculationPeriodDates ob = new CalculationPeriodDates(calculationPeriodDatesNode);
                        IDManager.SetID(calculationPeriodDatesIDRef_, ob);
                    }
                    else if (calculationPeriodDatesNode.Attributes["href"] != null)
                    {
                        calculationPeriodDatesIDRef_ = calculationPeriodDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodDates_ = new CalculationPeriodDates(calculationPeriodDatesNode);
                    }
                }
                else
                {
                    calculationPeriodDates_ = new CalculationPeriodDates(calculationPeriodDatesNode);
                }
            }


            XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");

            if (paymentDatesNode != null)
            {
                if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null)
                {
                    if (paymentDatesNode.Attributes["id"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                        PaymentDates ob = new PaymentDates(paymentDatesNode);
                        IDManager.SetID(paymentDatesIDRef_, ob);
                    }
                    else if (paymentDatesNode.Attributes["href"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDates_ = new PaymentDates(paymentDatesNode);
                    }
                }
                else
                {
                    paymentDates_ = new PaymentDates(paymentDatesNode);
                }
            }


            XmlNode resetDatesNode = xmlNode.SelectSingleNode("resetDates");

            if (resetDatesNode != null)
            {
                if (resetDatesNode.Attributes["href"] != null || resetDatesNode.Attributes["id"] != null)
                {
                    if (resetDatesNode.Attributes["id"] != null)
                    {
                        resetDatesIDRef_ = resetDatesNode.Attributes["id"].Value;
                        ResetDates ob = new ResetDates(resetDatesNode);
                        IDManager.SetID(resetDatesIDRef_, ob);
                    }
                    else if (resetDatesNode.Attributes["href"] != null)
                    {
                        resetDatesIDRef_ = resetDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        resetDates_ = new ResetDates(resetDatesNode);
                    }
                }
                else
                {
                    resetDates_ = new ResetDates(resetDatesNode);
                }
            }


            XmlNode calculationPeriodAmountNode = xmlNode.SelectSingleNode("calculationPeriodAmount");

            if (calculationPeriodAmountNode != null)
            {
                if (calculationPeriodAmountNode.Attributes["href"] != null || calculationPeriodAmountNode.Attributes["id"] != null)
                {
                    if (calculationPeriodAmountNode.Attributes["id"] != null)
                    {
                        calculationPeriodAmountIDRef_ = calculationPeriodAmountNode.Attributes["id"].Value;
                        CalculationPeriodAmount ob = new CalculationPeriodAmount(calculationPeriodAmountNode);
                        IDManager.SetID(calculationPeriodAmountIDRef_, ob);
                    }
                    else if (calculationPeriodAmountNode.Attributes["href"] != null)
                    {
                        calculationPeriodAmountIDRef_ = calculationPeriodAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodAmount_ = new CalculationPeriodAmount(calculationPeriodAmountNode);
                    }
                }
                else
                {
                    calculationPeriodAmount_ = new CalculationPeriodAmount(calculationPeriodAmountNode);
                }
            }


            XmlNode stubCalculationPeriodAmountNode = xmlNode.SelectSingleNode("stubCalculationPeriodAmount");

            if (stubCalculationPeriodAmountNode != null)
            {
                if (stubCalculationPeriodAmountNode.Attributes["href"] != null || stubCalculationPeriodAmountNode.Attributes["id"] != null)
                {
                    if (stubCalculationPeriodAmountNode.Attributes["id"] != null)
                    {
                        stubCalculationPeriodAmountIDRef_ = stubCalculationPeriodAmountNode.Attributes["id"].Value;
                        StubCalculationPeriodAmount ob = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
                        IDManager.SetID(stubCalculationPeriodAmountIDRef_, ob);
                    }
                    else if (stubCalculationPeriodAmountNode.Attributes["href"] != null)
                    {
                        stubCalculationPeriodAmountIDRef_ = stubCalculationPeriodAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        stubCalculationPeriodAmount_ = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
                    }
                }
                else
                {
                    stubCalculationPeriodAmount_ = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
                }
            }


            XmlNode principalExchangesNode = xmlNode.SelectSingleNode("principalExchanges");

            if (principalExchangesNode != null)
            {
                if (principalExchangesNode.Attributes["href"] != null || principalExchangesNode.Attributes["id"] != null)
                {
                    if (principalExchangesNode.Attributes["id"] != null)
                    {
                        principalExchangesIDRef_ = principalExchangesNode.Attributes["id"].Value;
                        PrincipalExchanges ob = new PrincipalExchanges(principalExchangesNode);
                        IDManager.SetID(principalExchangesIDRef_, ob);
                    }
                    else if (principalExchangesNode.Attributes["href"] != null)
                    {
                        principalExchangesIDRef_ = principalExchangesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        principalExchanges_ = new PrincipalExchanges(principalExchangesNode);
                    }
                }
                else
                {
                    principalExchanges_ = new PrincipalExchanges(principalExchangesNode);
                }
            }


            XmlNode cashflowsNode = xmlNode.SelectSingleNode("cashflows");

            if (cashflowsNode != null)
            {
                if (cashflowsNode.Attributes["href"] != null || cashflowsNode.Attributes["id"] != null)
                {
                    if (cashflowsNode.Attributes["id"] != null)
                    {
                        cashflowsIDRef_ = cashflowsNode.Attributes["id"].Value;
                        Cashflows ob = new Cashflows(cashflowsNode);
                        IDManager.SetID(cashflowsIDRef_, ob);
                    }
                    else if (cashflowsNode.Attributes["href"] != null)
                    {
                        cashflowsIDRef_ = cashflowsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashflows_ = new Cashflows(cashflowsNode);
                    }
                }
                else
                {
                    cashflows_ = new Cashflows(cashflowsNode);
                }
            }


            XmlNode settlementProvisionNode = xmlNode.SelectSingleNode("settlementProvision");

            if (settlementProvisionNode != null)
            {
                if (settlementProvisionNode.Attributes["href"] != null || settlementProvisionNode.Attributes["id"] != null)
                {
                    if (settlementProvisionNode.Attributes["id"] != null)
                    {
                        settlementProvisionIDRef_ = settlementProvisionNode.Attributes["id"].Value;
                        SettlementProvision ob = new SettlementProvision(settlementProvisionNode);
                        IDManager.SetID(settlementProvisionIDRef_, ob);
                    }
                    else if (settlementProvisionNode.Attributes["href"] != null)
                    {
                        settlementProvisionIDRef_ = settlementProvisionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementProvision_ = new SettlementProvision(settlementProvisionNode);
                    }
                }
                else
                {
                    settlementProvision_ = new SettlementProvision(settlementProvisionNode);
                }
            }


            XmlNode formulaNode = xmlNode.SelectSingleNode("formula");

            if (formulaNode != null)
            {
                if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null)
                {
                    if (formulaNode.Attributes["id"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["id"].Value;
                        Formula ob = new Formula(formulaNode);
                        IDManager.SetID(formulaIDRef_, ob);
                    }
                    else if (formulaNode.Attributes["href"] != null)
                    {
                        formulaIDRef_ = formulaNode.Attributes["href"].Value;
                    }
                    else
                    {
                        formula_ = new Formula(formulaNode);
                    }
                }
                else
                {
                    formula_ = new Formula(formulaNode);
                }
            }
        }
 public CancelableProvision(XmlNode xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(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");
     if (exerciseNoticeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseNoticeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef = item.Attributes["id"].Name;
                 ExerciseNotice ob = ExerciseNotice();
                 IDManager.SetID(exerciseNoticeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseNoticeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseNotice = 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 cancelableProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("cancelableProvisionAdjustedDates");
     if (cancelableProvisionAdjustedDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cancelableProvisionAdjustedDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cancelableProvisionAdjustedDatesIDRef = item.Attributes["id"].Name;
                 CancelableProvisionAdjustedDates ob = CancelableProvisionAdjustedDates();
                 IDManager.SetID(cancelableProvisionAdjustedDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cancelableProvisionAdjustedDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cancelableProvisionAdjustedDates = new CancelableProvisionAdjustedDates(item);
             }
         }
     }
     
 
     XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");
     
     foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["id"].Name;
                 List<FinalCalculationPeriodDateAdjustment> ob = new List<FinalCalculationPeriodDateAdjustment>();
                 ob.Add(new FinalCalculationPeriodDateAdjustment(item));
                 IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 finalCalculationPeriodDateAdjustmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
             finalCalculationPeriodDateAdjustment.Add(new FinalCalculationPeriodDateAdjustment(item));
             }
         }
     }
     
 
     XmlNodeList initialFeeNodeList = xmlNode.SelectNodes("initialFee");
     if (initialFeeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in initialFeeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 initialFeeIDRef = item.Attributes["id"].Name;
                 SimplePayment ob = SimplePayment();
                 IDManager.SetID(initialFeeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 initialFeeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 initialFee = new SimplePayment(item);
             }
         }
     }
     
 
 }
        public Allocation(XmlNode xmlNode)
        {
            XmlNodeList allocationTradeIdNodeList = xmlNode.SelectNodes("allocationTradeId");

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


            XmlNode partyReferenceNode = xmlNode.SelectSingleNode("partyReference");

            if (partyReferenceNode != null)
            {
                if (partyReferenceNode.Attributes["href"] != null || partyReferenceNode.Attributes["id"] != null)
                {
                    if (partyReferenceNode.Attributes["id"] != null)
                    {
                        partyReferenceIDRef_ = partyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(partyReferenceNode);
                        IDManager.SetID(partyReferenceIDRef_, ob);
                    }
                    else if (partyReferenceNode.Attributes["href"] != null)
                    {
                        partyReferenceIDRef_ = partyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        partyReference_ = new PartyReference(partyReferenceNode);
                    }
                }
                else
                {
                    partyReference_ = new PartyReference(partyReferenceNode);
                }
            }


            XmlNode accountReferenceNode = xmlNode.SelectSingleNode("accountReference");

            if (accountReferenceNode != null)
            {
                if (accountReferenceNode.Attributes["href"] != null || accountReferenceNode.Attributes["id"] != null)
                {
                    if (accountReferenceNode.Attributes["id"] != null)
                    {
                        accountReferenceIDRef_ = accountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(accountReferenceNode);
                        IDManager.SetID(accountReferenceIDRef_, ob);
                    }
                    else if (accountReferenceNode.Attributes["href"] != null)
                    {
                        accountReferenceIDRef_ = accountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        accountReference_ = new AccountReference(accountReferenceNode);
                    }
                }
                else
                {
                    accountReference_ = new AccountReference(accountReferenceNode);
                }
            }


            XmlNode allocatedFractionNode = xmlNode.SelectSingleNode("allocatedFraction");

            if (allocatedFractionNode != null)
            {
                if (allocatedFractionNode.Attributes["href"] != null || allocatedFractionNode.Attributes["id"] != null)
                {
                    if (allocatedFractionNode.Attributes["id"] != null)
                    {
                        allocatedFractionIDRef_ = allocatedFractionNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(allocatedFractionNode);
                        IDManager.SetID(allocatedFractionIDRef_, ob);
                    }
                    else if (allocatedFractionNode.Attributes["href"] != null)
                    {
                        allocatedFractionIDRef_ = allocatedFractionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        allocatedFraction_ = new XsdTypeDecimal(allocatedFractionNode);
                    }
                }
                else
                {
                    allocatedFraction_ = new XsdTypeDecimal(allocatedFractionNode);
                }
            }


            XmlNodeList allocatedNotionalNodeList = xmlNode.SelectNodes("allocatedNotional");

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


            XmlNode collateralNode = xmlNode.SelectSingleNode("collateral");

            if (collateralNode != null)
            {
                if (collateralNode.Attributes["href"] != null || collateralNode.Attributes["id"] != null)
                {
                    if (collateralNode.Attributes["id"] != null)
                    {
                        collateralIDRef_ = collateralNode.Attributes["id"].Value;
                        Collateral ob = new Collateral(collateralNode);
                        IDManager.SetID(collateralIDRef_, ob);
                    }
                    else if (collateralNode.Attributes["href"] != null)
                    {
                        collateralIDRef_ = collateralNode.Attributes["href"].Value;
                    }
                    else
                    {
                        collateral_ = new Collateral(collateralNode);
                    }
                }
                else
                {
                    collateral_ = new Collateral(collateralNode);
                }
            }


            XmlNode creditChargeAmountNode = xmlNode.SelectSingleNode("creditChargeAmount");

            if (creditChargeAmountNode != null)
            {
                if (creditChargeAmountNode.Attributes["href"] != null || creditChargeAmountNode.Attributes["id"] != null)
                {
                    if (creditChargeAmountNode.Attributes["id"] != null)
                    {
                        creditChargeAmountIDRef_ = creditChargeAmountNode.Attributes["id"].Value;
                        Money ob = new Money(creditChargeAmountNode);
                        IDManager.SetID(creditChargeAmountIDRef_, ob);
                    }
                    else if (creditChargeAmountNode.Attributes["href"] != null)
                    {
                        creditChargeAmountIDRef_ = creditChargeAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        creditChargeAmount_ = new Money(creditChargeAmountNode);
                    }
                }
                else
                {
                    creditChargeAmount_ = new Money(creditChargeAmountNode);
                }
            }


            XmlNode approvalsNode = xmlNode.SelectSingleNode("approvals");

            if (approvalsNode != null)
            {
                if (approvalsNode.Attributes["href"] != null || approvalsNode.Attributes["id"] != null)
                {
                    if (approvalsNode.Attributes["id"] != null)
                    {
                        approvalsIDRef_ = approvalsNode.Attributes["id"].Value;
                        Approvals ob = new Approvals(approvalsNode);
                        IDManager.SetID(approvalsIDRef_, ob);
                    }
                    else if (approvalsNode.Attributes["href"] != null)
                    {
                        approvalsIDRef_ = approvalsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        approvals_ = new Approvals(approvalsNode);
                    }
                }
                else
                {
                    approvals_ = new Approvals(approvalsNode);
                }
            }


            XmlNode masterConfirmationDateNode = xmlNode.SelectSingleNode("masterConfirmationDate");

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


            XmlNodeList relatedPartyNodeList = xmlNode.SelectNodes("relatedParty");

            if (relatedPartyNodeList != null)
            {
                this.relatedParty_ = new List <RelatedParty>();
                foreach (XmlNode item in relatedPartyNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            relatedPartyIDRef_ = item.Attributes["id"].Value;
                            relatedParty_.Add(new RelatedParty(item));
                            IDManager.SetID(relatedPartyIDRef_, relatedParty_[relatedParty_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            relatedPartyIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            relatedParty_.Add(new RelatedParty(item));
                        }
                    }
                    else
                    {
                        relatedParty_.Add(new RelatedParty(item));
                    }
                }
            }
        }
 public CancelableProvision(XmlNode xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     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);
         }
     }
     
 
     XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice");
     
     if (exerciseNoticeNode != null)
     {
         if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null) 
         {
             if (exerciseNoticeNode.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value;
                 ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode);
                 IDManager.SetID(exerciseNoticeIDRef_, ob);
             }
             else if (exerciseNoticeNode.Attributes["href"] != null)
             {
                 exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
             }
         }
         else
         {
             exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
         }
     }
     
 
     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 cancelableProvisionAdjustedDatesNode = xmlNode.SelectSingleNode("cancelableProvisionAdjustedDates");
     
     if (cancelableProvisionAdjustedDatesNode != null)
     {
         if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null || cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) 
         {
             if (cancelableProvisionAdjustedDatesNode.Attributes["id"] != null) 
             {
                 cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["id"].Value;
                 CancelableProvisionAdjustedDates ob = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
                 IDManager.SetID(cancelableProvisionAdjustedDatesIDRef_, ob);
             }
             else if (cancelableProvisionAdjustedDatesNode.Attributes["href"] != null)
             {
                 cancelableProvisionAdjustedDatesIDRef_ = cancelableProvisionAdjustedDatesNode.Attributes["href"].Value;
             }
             else
             {
                 cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
             }
         }
         else
         {
             cancelableProvisionAdjustedDates_ = new CancelableProvisionAdjustedDates(cancelableProvisionAdjustedDatesNode);
         }
     }
     
 
     XmlNodeList finalCalculationPeriodDateAdjustmentNodeList = xmlNode.SelectNodes("finalCalculationPeriodDateAdjustment");
     
     if (finalCalculationPeriodDateAdjustmentNodeList != null)
     {
         this.finalCalculationPeriodDateAdjustment_ = new List<FinalCalculationPeriodDateAdjustment>();
         foreach (XmlNode item in finalCalculationPeriodDateAdjustmentNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["id"].Value;
                     finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                     IDManager.SetID(finalCalculationPeriodDateAdjustmentIDRef_, finalCalculationPeriodDateAdjustment_[finalCalculationPeriodDateAdjustment_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     finalCalculationPeriodDateAdjustmentIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
                 }
             }
             else
             {
                 finalCalculationPeriodDateAdjustment_.Add(new FinalCalculationPeriodDateAdjustment(item));
             }
         }
     }
     
 
     XmlNode initialFeeNode = xmlNode.SelectSingleNode("initialFee");
     
     if (initialFeeNode != null)
     {
         if (initialFeeNode.Attributes["href"] != null || initialFeeNode.Attributes["id"] != null) 
         {
             if (initialFeeNode.Attributes["id"] != null) 
             {
                 initialFeeIDRef_ = initialFeeNode.Attributes["id"].Value;
                 SimplePayment ob = new SimplePayment(initialFeeNode);
                 IDManager.SetID(initialFeeIDRef_, ob);
             }
             else if (initialFeeNode.Attributes["href"] != null)
             {
                 initialFeeIDRef_ = initialFeeNode.Attributes["href"].Value;
             }
             else
             {
                 initialFee_ = new SimplePayment(initialFeeNode);
             }
         }
         else
         {
             initialFee_ = new SimplePayment(initialFeeNode);
         }
     }
     
 
 }
        public ReturnSwapBase(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList returnSwapLegNodeList = xmlNode.SelectNodes("returnSwapLeg");

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

            foreach (XmlNode item in returnSwapLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        returnSwapLegIDRef = item.Attributes["id"].Name;
                        DirectionalLeg ob = DirectionalLeg();
                        IDManager.SetID(returnSwapLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        returnSwapLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        returnSwapLeg = new DirectionalLeg(item);
                    }
                }
            }


            XmlNodeList interestLegNodeList = xmlNode.SelectNodes("interestLeg");

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

            foreach (XmlNode item in interestLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        interestLegIDRef = item.Attributes["id"].Name;
                        InterestLeg ob = InterestLeg();
                        IDManager.SetID(interestLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        interestLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        interestLeg = new InterestLeg(item);
                    }
                }
            }


            XmlNodeList returnLegNodeList = xmlNode.SelectNodes("returnLeg");

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

            foreach (XmlNode item in returnLegNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        returnLegIDRef = item.Attributes["id"].Name;
                        ReturnLeg ob = ReturnLeg();
                        IDManager.SetID(returnLegIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        returnLegIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        returnLeg = new ReturnLeg(item);
                    }
                }
            }


            XmlNodeList principalExchangeFeaturesNodeList = xmlNode.SelectNodes("principalExchangeFeatures");

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

            foreach (XmlNode item in principalExchangeFeaturesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        principalExchangeFeaturesIDRef = item.Attributes["id"].Name;
                        PrincipalExchangeFeatures ob = PrincipalExchangeFeatures();
                        IDManager.SetID(principalExchangeFeaturesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        principalExchangeFeaturesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        principalExchangeFeatures = new PrincipalExchangeFeatures(item);
                    }
                }
            }
        }
 public SinglePartyOption(XmlNode xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
 }
Example #24
0
        public FinancialSwapLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }
        }
 public TermDeposit(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode startDateNode = xmlNode.SelectSingleNode("startDate");
     
     if (startDateNode != null)
     {
         if (startDateNode.Attributes["href"] != null || startDateNode.Attributes["id"] != null) 
         {
             if (startDateNode.Attributes["id"] != null) 
             {
                 startDateIDRef_ = startDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(startDateNode);
                 IDManager.SetID(startDateIDRef_, ob);
             }
             else if (startDateNode.Attributes["href"] != null)
             {
                 startDateIDRef_ = startDateNode.Attributes["href"].Value;
             }
             else
             {
                 startDate_ = new XsdTypeDate(startDateNode);
             }
         }
         else
         {
             startDate_ = new XsdTypeDate(startDateNode);
         }
     }
     
 
     XmlNode maturityDateNode = xmlNode.SelectSingleNode("maturityDate");
     
     if (maturityDateNode != null)
     {
         if (maturityDateNode.Attributes["href"] != null || maturityDateNode.Attributes["id"] != null) 
         {
             if (maturityDateNode.Attributes["id"] != null) 
             {
                 maturityDateIDRef_ = maturityDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(maturityDateNode);
                 IDManager.SetID(maturityDateIDRef_, ob);
             }
             else if (maturityDateNode.Attributes["href"] != null)
             {
                 maturityDateIDRef_ = maturityDateNode.Attributes["href"].Value;
             }
             else
             {
                 maturityDate_ = new XsdTypeDate(maturityDateNode);
             }
         }
         else
         {
             maturityDate_ = new XsdTypeDate(maturityDateNode);
         }
     }
     
 
     XmlNode tenorNameNode = xmlNode.SelectSingleNode("tenorName");
     
     if (tenorNameNode != null)
     {
         if (tenorNameNode.Attributes["href"] != null || tenorNameNode.Attributes["id"] != null) 
         {
             if (tenorNameNode.Attributes["id"] != null) 
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(tenorNameNode);
                 IDManager.SetID(tenorNameIDRef_, ob);
             }
             else if (tenorNameNode.Attributes["href"] != null)
             {
                 tenorNameIDRef_ = tenorNameNode.Attributes["href"].Value;
             }
             else
             {
                 tenorName_ = new XsdTypeBoolean(tenorNameNode);
             }
         }
         else
         {
             tenorName_ = new XsdTypeBoolean(tenorNameNode);
         }
     }
     
 
     XmlNode tenorPeriodNode = xmlNode.SelectSingleNode("tenorPeriod");
     
     if (tenorPeriodNode != null)
     {
         if (tenorPeriodNode.Attributes["href"] != null || tenorPeriodNode.Attributes["id"] != null) 
         {
             if (tenorPeriodNode.Attributes["id"] != null) 
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["id"].Value;
                 Period ob = new Period(tenorPeriodNode);
                 IDManager.SetID(tenorPeriodIDRef_, ob);
             }
             else if (tenorPeriodNode.Attributes["href"] != null)
             {
                 tenorPeriodIDRef_ = tenorPeriodNode.Attributes["href"].Value;
             }
             else
             {
                 tenorPeriod_ = new Period(tenorPeriodNode);
             }
         }
         else
         {
             tenorPeriod_ = new Period(tenorPeriodNode);
         }
     }
     
 
     XmlNode principalNode = xmlNode.SelectSingleNode("principal");
     
     if (principalNode != null)
     {
         if (principalNode.Attributes["href"] != null || principalNode.Attributes["id"] != null) 
         {
             if (principalNode.Attributes["id"] != null) 
             {
                 principalIDRef_ = principalNode.Attributes["id"].Value;
                 PositiveMoney ob = new PositiveMoney(principalNode);
                 IDManager.SetID(principalIDRef_, ob);
             }
             else if (principalNode.Attributes["href"] != null)
             {
                 principalIDRef_ = principalNode.Attributes["href"].Value;
             }
             else
             {
                 principal_ = new PositiveMoney(principalNode);
             }
         }
         else
         {
             principal_ = new PositiveMoney(principalNode);
         }
     }
     
 
     XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");
     
     if (fixedRateNode != null)
     {
         if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null) 
         {
             if (fixedRateNode.Attributes["id"] != null) 
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(fixedRateNode);
                 IDManager.SetID(fixedRateIDRef_, ob);
             }
             else if (fixedRateNode.Attributes["href"] != null)
             {
                 fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
             }
             else
             {
                 fixedRate_ = new PositiveDecimal(fixedRateNode);
             }
         }
         else
         {
             fixedRate_ = new PositiveDecimal(fixedRateNode);
         }
     }
     
 
     XmlNode dayCountFractionNode = xmlNode.SelectSingleNode("dayCountFraction");
     
     if (dayCountFractionNode != null)
     {
         if (dayCountFractionNode.Attributes["href"] != null || dayCountFractionNode.Attributes["id"] != null) 
         {
             if (dayCountFractionNode.Attributes["id"] != null) 
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["id"].Value;
                 DayCountFraction ob = new DayCountFraction(dayCountFractionNode);
                 IDManager.SetID(dayCountFractionIDRef_, ob);
             }
             else if (dayCountFractionNode.Attributes["href"] != null)
             {
                 dayCountFractionIDRef_ = dayCountFractionNode.Attributes["href"].Value;
             }
             else
             {
                 dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
             }
         }
         else
         {
             dayCountFraction_ = new DayCountFraction(dayCountFractionNode);
         }
     }
     
 
     XmlNode featuresNode = xmlNode.SelectSingleNode("features");
     
     if (featuresNode != null)
     {
         if (featuresNode.Attributes["href"] != null || featuresNode.Attributes["id"] != null) 
         {
             if (featuresNode.Attributes["id"] != null) 
             {
                 featuresIDRef_ = featuresNode.Attributes["id"].Value;
                 TermDepositFeatures ob = new TermDepositFeatures(featuresNode);
                 IDManager.SetID(featuresIDRef_, ob);
             }
             else if (featuresNode.Attributes["href"] != null)
             {
                 featuresIDRef_ = featuresNode.Attributes["href"].Value;
             }
             else
             {
                 features_ = new TermDepositFeatures(featuresNode);
             }
         }
         else
         {
             features_ = new TermDepositFeatures(featuresNode);
         }
     }
     
 
     XmlNode interestNode = xmlNode.SelectSingleNode("interest");
     
     if (interestNode != null)
     {
         if (interestNode.Attributes["href"] != null || interestNode.Attributes["id"] != null) 
         {
             if (interestNode.Attributes["id"] != null) 
             {
                 interestIDRef_ = interestNode.Attributes["id"].Value;
                 Money ob = new Money(interestNode);
                 IDManager.SetID(interestIDRef_, ob);
             }
             else if (interestNode.Attributes["href"] != null)
             {
                 interestIDRef_ = interestNode.Attributes["href"].Value;
             }
             else
             {
                 interest_ = new Money(interestNode);
             }
         }
         else
         {
             interest_ = new Money(interestNode);
         }
     }
     
 
     XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");
     
     if (paymentNodeList != null)
     {
         this.payment_ = new List<Payment>();
         foreach (XmlNode item in paymentNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     paymentIDRef_ = item.Attributes["id"].Value;
                     payment_.Add(new Payment(item));
                     IDManager.SetID(paymentIDRef_, payment_[payment_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     paymentIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 payment_.Add(new Payment(item));
                 }
             }
             else
             {
                 payment_.Add(new Payment(item));
             }
         }
     }
     
 
 }
        public EquityDerivativeBase(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");

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

            foreach (XmlNode item in optionTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionTypeIDRef = item.Attributes["id"].Name;
                        EquityOptionTypeEnum ob = EquityOptionTypeEnum();
                        IDManager.SetID(optionTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionType = new EquityOptionTypeEnum(item);
                    }
                }
            }


            XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate");

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

            foreach (XmlNode item in equityEffectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        equityEffectiveDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(equityEffectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        equityEffectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        equityEffectiveDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");

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

            foreach (XmlNode item in underlyerNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        underlyerIDRef = item.Attributes["id"].Name;
                        Underlyer ob = Underlyer();
                        IDManager.SetID(underlyerIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        underlyerIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        underlyer = new Underlyer(item);
                    }
                }
            }


            XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");

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

            foreach (XmlNode item in notionalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(notionalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notional = new NonNegativeMoney(item);
                    }
                }
            }


            XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise");

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

            foreach (XmlNode item in equityExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        equityExerciseIDRef = item.Attributes["id"].Name;
                        EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement();
                        IDManager.SetID(equityExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        equityExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        equityExercise = new EquityExerciseValuationSettlement(item);
                    }
                }
            }


            XmlNodeList featureNodeList = xmlNode.SelectNodes("feature");

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

            foreach (XmlNode item in featureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        featureIDRef = item.Attributes["id"].Name;
                        OptionFeatures ob = OptionFeatures();
                        IDManager.SetID(featureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        feature = new OptionFeatures(item);
                    }
                }
            }


            XmlNodeList fxFeatureNodeList = xmlNode.SelectNodes("fxFeature");

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

            foreach (XmlNode item in fxFeatureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxFeatureIDRef = item.Attributes["id"].Name;
                        FxFeature ob = FxFeature();
                        IDManager.SetID(fxFeatureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxFeatureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fxFeature = new FxFeature(item);
                    }
                }
            }


            XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature");

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

            foreach (XmlNode item in strategyFeatureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        strategyFeatureIDRef = item.Attributes["id"].Name;
                        StrategyFeature ob = StrategyFeature();
                        IDManager.SetID(strategyFeatureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        strategyFeatureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        strategyFeature = new StrategyFeature(item);
                    }
                }
            }
        }
 public TradeNovationContent(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList newTradeIdentifierNodeList = xmlNode.SelectNodes("newTradeIdentifier");
     
     foreach (XmlNode item in newTradeIdentifierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 newTradeIdentifierIDRef = item.Attributes["id"].Name;
                 List<PartyTradeIdentifier> ob = new List<PartyTradeIdentifier>();
                 ob.Add(new PartyTradeIdentifier(item));
                 IDManager.SetID(newTradeIdentifierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 newTradeIdentifierIDRef = item.Attributes["href"].Name;
             }
             else
             {
             newTradeIdentifier.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList newTradeNodeList = xmlNode.SelectNodes("newTrade");
     if (newTradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in newTradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 newTradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(newTradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 newTradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 newTrade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList oldTradeIdentifierNodeList = xmlNode.SelectNodes("oldTradeIdentifier");
     
     foreach (XmlNode item in oldTradeIdentifierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 oldTradeIdentifierIDRef = item.Attributes["id"].Name;
                 List<PartyTradeIdentifier> ob = new List<PartyTradeIdentifier>();
                 ob.Add(new PartyTradeIdentifier(item));
                 IDManager.SetID(oldTradeIdentifierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 oldTradeIdentifierIDRef = item.Attributes["href"].Name;
             }
             else
             {
             oldTradeIdentifier.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList oldTradeNodeList = xmlNode.SelectNodes("oldTrade");
     if (oldTradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in oldTradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 oldTradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(oldTradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 oldTradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 oldTrade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList feeTradeIdentifierNodeList = xmlNode.SelectNodes("feeTradeIdentifier");
     if (feeTradeIdentifierNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in feeTradeIdentifierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 feeTradeIdentifierIDRef = item.Attributes["id"].Name;
                 PartyTradeIdentifier ob = PartyTradeIdentifier();
                 IDManager.SetID(feeTradeIdentifierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 feeTradeIdentifierIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feeTradeIdentifier = new PartyTradeIdentifier(item);
             }
         }
     }
     
 
     XmlNodeList feeTradeNodeList = xmlNode.SelectNodes("feeTrade");
     if (feeTradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in feeTradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 feeTradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(feeTradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 feeTradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feeTrade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList transferorNodeList = xmlNode.SelectNodes("transferor");
     if (transferorNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in transferorNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 transferorIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(transferorIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 transferorIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 transferor = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList transferorAccountNodeList = xmlNode.SelectNodes("transferorAccount");
     if (transferorAccountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in transferorAccountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 transferorAccountIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(transferorAccountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 transferorAccountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 transferorAccount = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList transfereeNodeList = xmlNode.SelectNodes("transferee");
     if (transfereeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in transfereeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 transfereeIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(transfereeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 transfereeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 transferee = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList otherTransfereeNodeList = xmlNode.SelectNodes("otherTransferee");
     if (otherTransfereeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in otherTransfereeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 otherTransfereeIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(otherTransfereeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 otherTransfereeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 otherTransferee = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList transfereeAccountNodeList = xmlNode.SelectNodes("transfereeAccount");
     if (transfereeAccountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in transfereeAccountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 transfereeAccountIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(transfereeAccountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 transfereeAccountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 transfereeAccount = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList otherTransfereeAccountNodeList = xmlNode.SelectNodes("otherTransfereeAccount");
     if (otherTransfereeAccountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in otherTransfereeAccountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 otherTransfereeAccountIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(otherTransfereeAccountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 otherTransfereeAccountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 otherTransfereeAccount = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList remainingPartyNodeList = xmlNode.SelectNodes("remainingParty");
     if (remainingPartyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in remainingPartyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 remainingPartyIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(remainingPartyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 remainingPartyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 remainingParty = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList remainingPartyAccountNodeList = xmlNode.SelectNodes("remainingPartyAccount");
     if (remainingPartyAccountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in remainingPartyAccountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 remainingPartyAccountIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(remainingPartyAccountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 remainingPartyAccountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 remainingPartyAccount = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList otherRemainingPartyNodeList = xmlNode.SelectNodes("otherRemainingParty");
     if (otherRemainingPartyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in otherRemainingPartyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 otherRemainingPartyIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(otherRemainingPartyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 otherRemainingPartyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 otherRemainingParty = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList otherRemainingPartyAccountNodeList = xmlNode.SelectNodes("otherRemainingPartyAccount");
     if (otherRemainingPartyAccountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in otherRemainingPartyAccountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 otherRemainingPartyAccountIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(otherRemainingPartyAccountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 otherRemainingPartyAccountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 otherRemainingPartyAccount = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList novationDateNodeList = xmlNode.SelectNodes("novationDate");
     if (novationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(novationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novationDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList executionDateTimeNodeList = xmlNode.SelectNodes("executionDateTime");
     if (executionDateTimeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in executionDateTimeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 executionDateTimeIDRef = item.Attributes["id"].Name;
                 ExecutionDateTime ob = ExecutionDateTime();
                 IDManager.SetID(executionDateTimeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 executionDateTimeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 executionDateTime = new ExecutionDateTime(item);
             }
         }
     }
     
 
     XmlNodeList novationTradeDateNodeList = xmlNode.SelectNodes("novationTradeDate");
     if (novationTradeDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationTradeDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationTradeDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(novationTradeDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationTradeDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novationTradeDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList novatedAmountNodeList = xmlNode.SelectNodes("novatedAmount");
     
     foreach (XmlNode item in novatedAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novatedAmountIDRef = item.Attributes["id"].Name;
                 List<Money> ob = new List<Money>();
                 ob.Add(new Money(item));
                 IDManager.SetID(novatedAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novatedAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
             novatedAmount.Add(new Money(item));
             }
         }
     }
     
 
     XmlNodeList remainingAmountNodeList = xmlNode.SelectNodes("remainingAmount");
     
     foreach (XmlNode item in remainingAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 remainingAmountIDRef = item.Attributes["id"].Name;
                 List<Money> ob = new List<Money>();
                 ob.Add(new Money(item));
                 IDManager.SetID(remainingAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 remainingAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
             remainingAmount.Add(new Money(item));
             }
         }
     }
     
 
     XmlNodeList novatedNumberOfOptionsNodeList = xmlNode.SelectNodes("novatedNumberOfOptions");
     if (novatedNumberOfOptionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novatedNumberOfOptionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novatedNumberOfOptionsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(novatedNumberOfOptionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novatedNumberOfOptionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novatedNumberOfOptions = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList remainingNumberOfOptionsNodeList = xmlNode.SelectNodes("remainingNumberOfOptions");
     if (remainingNumberOfOptionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in remainingNumberOfOptionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 remainingNumberOfOptionsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(remainingNumberOfOptionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 remainingNumberOfOptionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 remainingNumberOfOptions = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList novatedNumberOfUnitsNodeList = xmlNode.SelectNodes("novatedNumberOfUnits");
     if (novatedNumberOfUnitsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novatedNumberOfUnitsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novatedNumberOfUnitsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(novatedNumberOfUnitsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novatedNumberOfUnitsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novatedNumberOfUnits = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList remainingNumberOfUnitsNodeList = xmlNode.SelectNodes("remainingNumberOfUnits");
     if (remainingNumberOfUnitsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in remainingNumberOfUnitsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 remainingNumberOfUnitsIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(remainingNumberOfUnitsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 remainingNumberOfUnitsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 remainingNumberOfUnits = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList fullFirstCalculationPeriodNodeList = xmlNode.SelectNodes("fullFirstCalculationPeriod");
     if (fullFirstCalculationPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fullFirstCalculationPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fullFirstCalculationPeriodIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(fullFirstCalculationPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fullFirstCalculationPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fullFirstCalculationPeriod = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList firstPeriodStartDateNodeList = xmlNode.SelectNodes("firstPeriodStartDate");
     
     foreach (XmlNode item in firstPeriodStartDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 firstPeriodStartDateIDRef = item.Attributes["id"].Name;
                 List<FirstPeriodStartDate> ob = new List<FirstPeriodStartDate>();
                 ob.Add(new FirstPeriodStartDate(item));
                 IDManager.SetID(firstPeriodStartDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 firstPeriodStartDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
             firstPeriodStartDate.Add(new FirstPeriodStartDate(item));
             }
         }
     }
     
 
     XmlNodeList nonRelianceNodeList = xmlNode.SelectNodes("nonReliance");
     if (nonRelianceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in nonRelianceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 nonRelianceIDRef = item.Attributes["id"].Name;
                 Empty ob = Empty();
                 IDManager.SetID(nonRelianceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 nonRelianceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 nonReliance = new Empty(item);
             }
         }
     }
     
 
     XmlNodeList creditDerivativesNoticesNodeList = xmlNode.SelectNodes("creditDerivativesNotices");
     if (creditDerivativesNoticesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in creditDerivativesNoticesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 creditDerivativesNoticesIDRef = item.Attributes["id"].Name;
                 CreditDerivativesNotices ob = CreditDerivativesNotices();
                 IDManager.SetID(creditDerivativesNoticesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 creditDerivativesNoticesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 creditDerivativesNotices = new CreditDerivativesNotices(item);
             }
         }
     }
     
 
     XmlNodeList contractualDefinitionsNodeList = xmlNode.SelectNodes("contractualDefinitions");
     
     foreach (XmlNode item in contractualDefinitionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 contractualDefinitionsIDRef = item.Attributes["id"].Name;
                 List<ContractualDefinitions> ob = new List<ContractualDefinitions>();
                 ob.Add(new ContractualDefinitions(item));
                 IDManager.SetID(contractualDefinitionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 contractualDefinitionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
             contractualDefinitions.Add(new ContractualDefinitions(item));
             }
         }
     }
     
 
     XmlNodeList contractualTermsSupplementNodeList = xmlNode.SelectNodes("contractualTermsSupplement");
     
     foreach (XmlNode item in contractualTermsSupplementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 contractualTermsSupplementIDRef = item.Attributes["id"].Name;
                 List<ContractualTermsSupplement> ob = new List<ContractualTermsSupplement>();
                 ob.Add(new ContractualTermsSupplement(item));
                 IDManager.SetID(contractualTermsSupplementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 contractualTermsSupplementIDRef = item.Attributes["href"].Name;
             }
             else
             {
             contractualTermsSupplement.Add(new ContractualTermsSupplement(item));
             }
         }
     }
     
 
     XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");
     if (paymentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentIDRef = item.Attributes["id"].Name;
                 Payment ob = Payment();
                 IDManager.SetID(paymentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payment = new Payment(item);
             }
         }
     }
     
 
 }
        public BusinessEventIdentifier(XmlNode xmlNode)
        {
            XmlNode partyReferenceNode = xmlNode.SelectSingleNode("partyReference");

            if (partyReferenceNode != null)
            {
                if (partyReferenceNode.Attributes["href"] != null || partyReferenceNode.Attributes["id"] != null)
                {
                    if (partyReferenceNode.Attributes["id"] != null)
                    {
                        partyReferenceIDRef_ = partyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(partyReferenceNode);
                        IDManager.SetID(partyReferenceIDRef_, ob);
                    }
                    else if (partyReferenceNode.Attributes["href"] != null)
                    {
                        partyReferenceIDRef_ = partyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        partyReference_ = new PartyReference(partyReferenceNode);
                    }
                }
                else
                {
                    partyReference_ = new PartyReference(partyReferenceNode);
                }
            }


            XmlNode accountReferenceNode = xmlNode.SelectSingleNode("accountReference");

            if (accountReferenceNode != null)
            {
                if (accountReferenceNode.Attributes["href"] != null || accountReferenceNode.Attributes["id"] != null)
                {
                    if (accountReferenceNode.Attributes["id"] != null)
                    {
                        accountReferenceIDRef_ = accountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(accountReferenceNode);
                        IDManager.SetID(accountReferenceIDRef_, ob);
                    }
                    else if (accountReferenceNode.Attributes["href"] != null)
                    {
                        accountReferenceIDRef_ = accountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        accountReference_ = new AccountReference(accountReferenceNode);
                    }
                }
                else
                {
                    accountReference_ = new AccountReference(accountReferenceNode);
                }
            }


            XmlNode eventIdNode = xmlNode.SelectSingleNode("eventId");

            if (eventIdNode != null)
            {
                if (eventIdNode.Attributes["href"] != null || eventIdNode.Attributes["id"] != null)
                {
                    if (eventIdNode.Attributes["id"] != null)
                    {
                        eventIdIDRef_ = eventIdNode.Attributes["id"].Value;
                        EventId ob = new EventId(eventIdNode);
                        IDManager.SetID(eventIdIDRef_, ob);
                    }
                    else if (eventIdNode.Attributes["href"] != null)
                    {
                        eventIdIDRef_ = eventIdNode.Attributes["href"].Value;
                    }
                    else
                    {
                        eventId_ = new EventId(eventIdNode);
                    }
                }
                else
                {
                    eventId_ = new EventId(eventIdNode);
                }
            }
        }
 public ProposedCollateralAllocation(XmlNode xmlNode)
 {
     XmlNode allocationPartyReferenceNode = xmlNode.SelectSingleNode("allocationPartyReference");
     
     if (allocationPartyReferenceNode != null)
     {
         if (allocationPartyReferenceNode.Attributes["href"] != null || allocationPartyReferenceNode.Attributes["id"] != null) 
         {
             if (allocationPartyReferenceNode.Attributes["id"] != null) 
             {
                 allocationPartyReferenceIDRef_ = allocationPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(allocationPartyReferenceNode);
                 IDManager.SetID(allocationPartyReferenceIDRef_, ob);
             }
             else if (allocationPartyReferenceNode.Attributes["href"] != null)
             {
                 allocationPartyReferenceIDRef_ = allocationPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 allocationPartyReference_ = new PartyReference(allocationPartyReferenceNode);
             }
         }
         else
         {
             allocationPartyReference_ = new PartyReference(allocationPartyReferenceNode);
         }
     }
     
 
     XmlNode allocationAccountReferenceNode = xmlNode.SelectSingleNode("allocationAccountReference");
     
     if (allocationAccountReferenceNode != null)
     {
         if (allocationAccountReferenceNode.Attributes["href"] != null || allocationAccountReferenceNode.Attributes["id"] != null) 
         {
             if (allocationAccountReferenceNode.Attributes["id"] != null) 
             {
                 allocationAccountReferenceIDRef_ = allocationAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(allocationAccountReferenceNode);
                 IDManager.SetID(allocationAccountReferenceIDRef_, ob);
             }
             else if (allocationAccountReferenceNode.Attributes["href"] != null)
             {
                 allocationAccountReferenceIDRef_ = allocationAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 allocationAccountReference_ = new AccountReference(allocationAccountReferenceNode);
             }
         }
         else
         {
             allocationAccountReference_ = new AccountReference(allocationAccountReferenceNode);
         }
     }
     
 
     XmlNode collateralValueAllocationNode = xmlNode.SelectSingleNode("collateralValueAllocation");
     
     if (collateralValueAllocationNode != null)
     {
         if (collateralValueAllocationNode.Attributes["href"] != null || collateralValueAllocationNode.Attributes["id"] != null) 
         {
             if (collateralValueAllocationNode.Attributes["id"] != null) 
             {
                 collateralValueAllocationIDRef_ = collateralValueAllocationNode.Attributes["id"].Value;
                 CollateralValueAllocation ob = new CollateralValueAllocation(collateralValueAllocationNode);
                 IDManager.SetID(collateralValueAllocationIDRef_, ob);
             }
             else if (collateralValueAllocationNode.Attributes["href"] != null)
             {
                 collateralValueAllocationIDRef_ = collateralValueAllocationNode.Attributes["href"].Value;
             }
             else
             {
                 collateralValueAllocation_ = new CollateralValueAllocation(collateralValueAllocationNode);
             }
         }
         else
         {
             collateralValueAllocation_ = new CollateralValueAllocation(collateralValueAllocationNode);
         }
     }
     
 
 }
        public ExtendibleProvision(XmlNode xmlNode)
        {
            XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");

            if (buyerPartyReferenceNode != null)
            {
                if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (buyerPartyReferenceNode.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                        IDManager.SetID(buyerPartyReferenceIDRef_, ob);
                    }
                    else if (buyerPartyReferenceNode.Attributes["href"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                    }
                }
                else
                {
                    buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                }
            }


            XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");

            if (buyerAccountReferenceNode != null)
            {
                if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (buyerAccountReferenceNode.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                        IDManager.SetID(buyerAccountReferenceIDRef_, ob);
                    }
                    else if (buyerAccountReferenceNode.Attributes["href"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                    }
                }
                else
                {
                    buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                }
            }


            XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");

            if (sellerPartyReferenceNode != null)
            {
                if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (sellerPartyReferenceNode.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                        IDManager.SetID(sellerPartyReferenceIDRef_, ob);
                    }
                    else if (sellerPartyReferenceNode.Attributes["href"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                    }
                }
                else
                {
                    sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                }
            }


            XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");

            if (sellerAccountReferenceNode != null)
            {
                if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (sellerAccountReferenceNode.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                        IDManager.SetID(sellerAccountReferenceIDRef_, ob);
                    }
                    else if (sellerAccountReferenceNode.Attributes["href"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                    }
                }
                else
                {
                    sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                }
            }


            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);
                }
            }


            XmlNode exerciseNoticeNode = xmlNode.SelectSingleNode("exerciseNotice");

            if (exerciseNoticeNode != null)
            {
                if (exerciseNoticeNode.Attributes["href"] != null || exerciseNoticeNode.Attributes["id"] != null)
                {
                    if (exerciseNoticeNode.Attributes["id"] != null)
                    {
                        exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["id"].Value;
                        ExerciseNotice ob = new ExerciseNotice(exerciseNoticeNode);
                        IDManager.SetID(exerciseNoticeIDRef_, ob);
                    }
                    else if (exerciseNoticeNode.Attributes["href"] != null)
                    {
                        exerciseNoticeIDRef_ = exerciseNoticeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
                    }
                }
                else
                {
                    exerciseNotice_ = new ExerciseNotice(exerciseNoticeNode);
                }
            }


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

            if (extendibleProvisionAdjustedDatesNode != null)
            {
                if (extendibleProvisionAdjustedDatesNode.Attributes["href"] != null || extendibleProvisionAdjustedDatesNode.Attributes["id"] != null)
                {
                    if (extendibleProvisionAdjustedDatesNode.Attributes["id"] != null)
                    {
                        extendibleProvisionAdjustedDatesIDRef_ = extendibleProvisionAdjustedDatesNode.Attributes["id"].Value;
                        ExtendibleProvisionAdjustedDates ob = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode);
                        IDManager.SetID(extendibleProvisionAdjustedDatesIDRef_, ob);
                    }
                    else if (extendibleProvisionAdjustedDatesNode.Attributes["href"] != null)
                    {
                        extendibleProvisionAdjustedDatesIDRef_ = extendibleProvisionAdjustedDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        extendibleProvisionAdjustedDates_ = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode);
                    }
                }
                else
                {
                    extendibleProvisionAdjustedDates_ = new ExtendibleProvisionAdjustedDates(extendibleProvisionAdjustedDatesNode);
                }
            }
        }
        public TradeUnderlyer2(XmlNode xmlNode)
        {
            XmlNode floatingRateNode = xmlNode.SelectSingleNode("floatingRate");

            if (floatingRateNode != null)
            {
                if (floatingRateNode.Attributes["href"] != null || floatingRateNode.Attributes["id"] != null)
                {
                    if (floatingRateNode.Attributes["id"] != null)
                    {
                        floatingRateIDRef_ = floatingRateNode.Attributes["id"].Value;
                        FloatingRate ob = new FloatingRate(floatingRateNode);
                        IDManager.SetID(floatingRateIDRef_, ob);
                    }
                    else if (floatingRateNode.Attributes["href"] != null)
                    {
                        floatingRateIDRef_ = floatingRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        floatingRate_ = new FloatingRate(floatingRateNode);
                    }
                }
                else
                {
                    floatingRate_ = new FloatingRate(floatingRateNode);
                }
            }


            XmlNode fixedRateNode = xmlNode.SelectSingleNode("fixedRate");

            if (fixedRateNode != null)
            {
                if (fixedRateNode.Attributes["href"] != null || fixedRateNode.Attributes["id"] != null)
                {
                    if (fixedRateNode.Attributes["id"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["id"].Value;
                        Schedule ob = new Schedule(fixedRateNode);
                        IDManager.SetID(fixedRateIDRef_, ob);
                    }
                    else if (fixedRateNode.Attributes["href"] != null)
                    {
                        fixedRateIDRef_ = fixedRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedRate_ = new Schedule(fixedRateNode);
                    }
                }
                else
                {
                    fixedRate_ = new Schedule(fixedRateNode);
                }
            }


            XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset");

            if (underlyingAssetNode != null)
            {
                if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null)
                {
                    if (underlyingAssetNode.Attributes["id"] != null)
                    {
                        underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value;
                        Asset ob = new Asset(underlyingAssetNode);
                        IDManager.SetID(underlyingAssetIDRef_, ob);
                    }
                    else if (underlyingAssetNode.Attributes["href"] != null)
                    {
                        underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value;
                    }
                    else
                    {
                        underlyingAsset_ = new Asset(underlyingAssetNode);
                    }
                }
                else
                {
                    underlyingAsset_ = new Asset(underlyingAssetNode);
                }
            }


            XmlNode basketNode = xmlNode.SelectSingleNode("basket");

            if (basketNode != null)
            {
                if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null)
                {
                    if (basketNode.Attributes["id"] != null)
                    {
                        basketIDRef_ = basketNode.Attributes["id"].Value;
                        Basket ob = new Basket(basketNode);
                        IDManager.SetID(basketIDRef_, ob);
                    }
                    else if (basketNode.Attributes["href"] != null)
                    {
                        basketIDRef_ = basketNode.Attributes["href"].Value;
                    }
                    else
                    {
                        basket_ = new Basket(basketNode);
                    }
                }
                else
                {
                    basket_ = new Basket(basketNode);
                }
            }


            XmlNode bondNode = xmlNode.SelectSingleNode("bond");

            if (bondNode != null)
            {
                if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null)
                {
                    if (bondNode.Attributes["id"] != null)
                    {
                        bondIDRef_ = bondNode.Attributes["id"].Value;
                        Bond ob = new Bond(bondNode);
                        IDManager.SetID(bondIDRef_, ob);
                    }
                    else if (bondNode.Attributes["href"] != null)
                    {
                        bondIDRef_ = bondNode.Attributes["href"].Value;
                    }
                    else
                    {
                        bond_ = new Bond(bondNode);
                    }
                }
                else
                {
                    bond_ = new Bond(bondNode);
                }
            }


            XmlNode cashNode = xmlNode.SelectSingleNode("cash");

            if (cashNode != null)
            {
                if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null)
                {
                    if (cashNode.Attributes["id"] != null)
                    {
                        cashIDRef_ = cashNode.Attributes["id"].Value;
                        Cash ob = new Cash(cashNode);
                        IDManager.SetID(cashIDRef_, ob);
                    }
                    else if (cashNode.Attributes["href"] != null)
                    {
                        cashIDRef_ = cashNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cash_ = new Cash(cashNode);
                    }
                }
                else
                {
                    cash_ = new Cash(cashNode);
                }
            }


            XmlNode commodityNode = xmlNode.SelectSingleNode("commodity");

            if (commodityNode != null)
            {
                if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null)
                {
                    if (commodityNode.Attributes["id"] != null)
                    {
                        commodityIDRef_ = commodityNode.Attributes["id"].Value;
                        Commodity ob = new Commodity(commodityNode);
                        IDManager.SetID(commodityIDRef_, ob);
                    }
                    else if (commodityNode.Attributes["href"] != null)
                    {
                        commodityIDRef_ = commodityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        commodity_ = new Commodity(commodityNode);
                    }
                }
                else
                {
                    commodity_ = new Commodity(commodityNode);
                }
            }


            XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond");

            if (convertibleBondNode != null)
            {
                if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null)
                {
                    if (convertibleBondNode.Attributes["id"] != null)
                    {
                        convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value;
                        ConvertibleBond ob = new ConvertibleBond(convertibleBondNode);
                        IDManager.SetID(convertibleBondIDRef_, ob);
                    }
                    else if (convertibleBondNode.Attributes["href"] != null)
                    {
                        convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value;
                    }
                    else
                    {
                        convertibleBond_ = new ConvertibleBond(convertibleBondNode);
                    }
                }
                else
                {
                    convertibleBond_ = new ConvertibleBond(convertibleBondNode);
                }
            }


            XmlNode equityNode = xmlNode.SelectSingleNode("equity");

            if (equityNode != null)
            {
                if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null)
                {
                    if (equityNode.Attributes["id"] != null)
                    {
                        equityIDRef_ = equityNode.Attributes["id"].Value;
                        EquityAsset ob = new EquityAsset(equityNode);
                        IDManager.SetID(equityIDRef_, ob);
                    }
                    else if (equityNode.Attributes["href"] != null)
                    {
                        equityIDRef_ = equityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        equity_ = new EquityAsset(equityNode);
                    }
                }
                else
                {
                    equity_ = new EquityAsset(equityNode);
                }
            }


            XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund");

            if (exchangeTradedFundNode != null)
            {
                if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null)
                {
                    if (exchangeTradedFundNode.Attributes["id"] != null)
                    {
                        exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value;
                        ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode);
                        IDManager.SetID(exchangeTradedFundIDRef_, ob);
                    }
                    else if (exchangeTradedFundNode.Attributes["href"] != null)
                    {
                        exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
                    }
                }
                else
                {
                    exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
                }
            }


            XmlNode futureNode = xmlNode.SelectSingleNode("future");

            if (futureNode != null)
            {
                if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null)
                {
                    if (futureNode.Attributes["id"] != null)
                    {
                        futureIDRef_ = futureNode.Attributes["id"].Value;
                        Future ob = new Future(futureNode);
                        IDManager.SetID(futureIDRef_, ob);
                    }
                    else if (futureNode.Attributes["href"] != null)
                    {
                        futureIDRef_ = futureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        future_ = new Future(futureNode);
                    }
                }
                else
                {
                    future_ = new Future(futureNode);
                }
            }


            XmlNode indexNode = xmlNode.SelectSingleNode("index");

            if (indexNode != null)
            {
                if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null)
                {
                    if (indexNode.Attributes["id"] != null)
                    {
                        indexIDRef_ = indexNode.Attributes["id"].Value;
                        Index ob = new Index(indexNode);
                        IDManager.SetID(indexIDRef_, ob);
                    }
                    else if (indexNode.Attributes["href"] != null)
                    {
                        indexIDRef_ = indexNode.Attributes["href"].Value;
                    }
                    else
                    {
                        index_ = new Index(indexNode);
                    }
                }
                else
                {
                    index_ = new Index(indexNode);
                }
            }


            XmlNode loanNode = xmlNode.SelectSingleNode("loan");

            if (loanNode != null)
            {
                if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null)
                {
                    if (loanNode.Attributes["id"] != null)
                    {
                        loanIDRef_ = loanNode.Attributes["id"].Value;
                        Loan ob = new Loan(loanNode);
                        IDManager.SetID(loanIDRef_, ob);
                    }
                    else if (loanNode.Attributes["href"] != null)
                    {
                        loanIDRef_ = loanNode.Attributes["href"].Value;
                    }
                    else
                    {
                        loan_ = new Loan(loanNode);
                    }
                }
                else
                {
                    loan_ = new Loan(loanNode);
                }
            }


            XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage");

            if (mortgageNode != null)
            {
                if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null)
                {
                    if (mortgageNode.Attributes["id"] != null)
                    {
                        mortgageIDRef_ = mortgageNode.Attributes["id"].Value;
                        Mortgage ob = new Mortgage(mortgageNode);
                        IDManager.SetID(mortgageIDRef_, ob);
                    }
                    else if (mortgageNode.Attributes["href"] != null)
                    {
                        mortgageIDRef_ = mortgageNode.Attributes["href"].Value;
                    }
                    else
                    {
                        mortgage_ = new Mortgage(mortgageNode);
                    }
                }
                else
                {
                    mortgage_ = new Mortgage(mortgageNode);
                }
            }


            XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund");

            if (mutualFundNode != null)
            {
                if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null)
                {
                    if (mutualFundNode.Attributes["id"] != null)
                    {
                        mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value;
                        MutualFund ob = new MutualFund(mutualFundNode);
                        IDManager.SetID(mutualFundIDRef_, ob);
                    }
                    else if (mutualFundNode.Attributes["href"] != null)
                    {
                        mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value;
                    }
                    else
                    {
                        mutualFund_ = new MutualFund(mutualFundNode);
                    }
                }
                else
                {
                    mutualFund_ = new MutualFund(mutualFundNode);
                }
            }


            XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair");

            if (quotedCurrencyPairNode != null)
            {
                if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null)
                {
                    if (quotedCurrencyPairNode.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value;
                        QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode);
                        IDManager.SetID(quotedCurrencyPairIDRef_, ob);
                    }
                    else if (quotedCurrencyPairNode.Attributes["href"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value;
                    }
                    else
                    {
                        quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                    }
                }
                else
                {
                    quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                }
            }


            XmlNode referenceEntityNode = xmlNode.SelectSingleNode("referenceEntity");

            if (referenceEntityNode != null)
            {
                if (referenceEntityNode.Attributes["href"] != null || referenceEntityNode.Attributes["id"] != null)
                {
                    if (referenceEntityNode.Attributes["id"] != null)
                    {
                        referenceEntityIDRef_ = referenceEntityNode.Attributes["id"].Value;
                        LegalEntity ob = new LegalEntity(referenceEntityNode);
                        IDManager.SetID(referenceEntityIDRef_, ob);
                    }
                    else if (referenceEntityNode.Attributes["href"] != null)
                    {
                        referenceEntityIDRef_ = referenceEntityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        referenceEntity_ = new LegalEntity(referenceEntityNode);
                    }
                }
                else
                {
                    referenceEntity_ = new LegalEntity(referenceEntityNode);
                }
            }


            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

            if (payerPartyReferenceNode != null)
            {
                if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (payerPartyReferenceNode.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(payerPartyReferenceNode);
                        IDManager.SetID(payerPartyReferenceIDRef_, ob);
                    }
                    else if (payerPartyReferenceNode.Attributes["href"] != null)
                    {
                        payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                    }
                }
                else
                {
                    payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
                }
            }


            XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");

            if (payerAccountReferenceNode != null)
            {
                if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (payerAccountReferenceNode.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(payerAccountReferenceNode);
                        IDManager.SetID(payerAccountReferenceIDRef_, ob);
                    }
                    else if (payerAccountReferenceNode.Attributes["href"] != null)
                    {
                        payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                    }
                }
                else
                {
                    payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
                }
            }


            XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");

            if (receiverPartyReferenceNode != null)
            {
                if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null)
                {
                    if (receiverPartyReferenceNode.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                        IDManager.SetID(receiverPartyReferenceIDRef_, ob);
                    }
                    else if (receiverPartyReferenceNode.Attributes["href"] != null)
                    {
                        receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                    }
                }
                else
                {
                    receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
                }
            }


            XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");

            if (receiverAccountReferenceNode != null)
            {
                if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null)
                {
                    if (receiverAccountReferenceNode.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                        IDManager.SetID(receiverAccountReferenceIDRef_, ob);
                    }
                    else if (receiverAccountReferenceNode.Attributes["href"] != null)
                    {
                        receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                    }
                }
                else
                {
                    receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
                }
            }
        }
Example #32
0
        public SinglePartyOption(XmlNode xmlNode)
        {
            XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");

            if (buyerPartyReferenceNode != null)
            {
                if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (buyerPartyReferenceNode.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                        IDManager.SetID(buyerPartyReferenceIDRef_, ob);
                    }
                    else if (buyerPartyReferenceNode.Attributes["href"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                    }
                }
                else
                {
                    buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                }
            }


            XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");

            if (buyerAccountReferenceNode != null)
            {
                if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (buyerAccountReferenceNode.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                        IDManager.SetID(buyerAccountReferenceIDRef_, ob);
                    }
                    else if (buyerAccountReferenceNode.Attributes["href"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                    }
                }
                else
                {
                    buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                }
            }


            XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");

            if (sellerPartyReferenceNode != null)
            {
                if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (sellerPartyReferenceNode.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                        IDManager.SetID(sellerPartyReferenceIDRef_, ob);
                    }
                    else if (sellerPartyReferenceNode.Attributes["href"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                    }
                }
                else
                {
                    sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                }
            }


            XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");

            if (sellerAccountReferenceNode != null)
            {
                if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (sellerAccountReferenceNode.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                        IDManager.SetID(sellerAccountReferenceIDRef_, ob);
                    }
                    else if (sellerAccountReferenceNode.Attributes["href"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                    }
                }
                else
                {
                    sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                }
            }
        }
        public IndependentAmount(XmlNode xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList paymentDetailNodeList = xmlNode.SelectNodes("paymentDetail");

            foreach (XmlNode item in paymentDetailNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDetailIDRef = item.Attributes["id"].Name;
                        List <PaymentDetail> ob = new List <PaymentDetail>();
                        ob.Add(new PaymentDetail(item));
                        IDManager.SetID(paymentDetailIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDetailIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDetail.Add(new PaymentDetail(item));
                    }
                }
            }
        }
 public Allocation(XmlNode xmlNode)
 {
     XmlNodeList allocationTradeIdNodeList = xmlNode.SelectNodes("allocationTradeId");
     
     foreach (XmlNode item in allocationTradeIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 allocationTradeIdIDRef = item.Attributes["id"].Name;
                 List<TradeIdentifier> ob = new List<TradeIdentifier>();
                 ob.Add(new TradeIdentifier(item));
                 IDManager.SetID(allocationTradeIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 allocationTradeIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
             allocationTradeId.Add(new TradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList partyReferenceNodeList = xmlNode.SelectNodes("partyReference");
     if (partyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in partyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(partyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 partyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList accountReferenceNodeList = xmlNode.SelectNodes("accountReference");
     if (accountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in accountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 accountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(accountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 accountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 accountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList allocatedFractionNodeList = xmlNode.SelectNodes("allocatedFraction");
     if (allocatedFractionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in allocatedFractionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 allocatedFractionIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(allocatedFractionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 allocatedFractionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 allocatedFraction = new XsdTypeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList allocatedNotionalNodeList = xmlNode.SelectNodes("allocatedNotional");
     
     foreach (XmlNode item in allocatedNotionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 allocatedNotionalIDRef = item.Attributes["id"].Name;
                 List<Money> ob = new List<Money>();
                 ob.Add(new Money(item));
                 IDManager.SetID(allocatedNotionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 allocatedNotionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
             allocatedNotional.Add(new Money(item));
             }
         }
     }
     
 
     XmlNodeList collateralNodeList = xmlNode.SelectNodes("collateral");
     if (collateralNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in collateralNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 collateralIDRef = item.Attributes["id"].Name;
                 Collateral ob = Collateral();
                 IDManager.SetID(collateralIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 collateralIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 collateral = new Collateral(item);
             }
         }
     }
     
 
     XmlNodeList creditChargeAmountNodeList = xmlNode.SelectNodes("creditChargeAmount");
     if (creditChargeAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in creditChargeAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 creditChargeAmountIDRef = item.Attributes["id"].Name;
                 Money ob = Money();
                 IDManager.SetID(creditChargeAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 creditChargeAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 creditChargeAmount = new Money(item);
             }
         }
     }
     
 
     XmlNodeList approvalsNodeList = xmlNode.SelectNodes("approvals");
     if (approvalsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in approvalsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 approvalsIDRef = item.Attributes["id"].Name;
                 Approvals ob = Approvals();
                 IDManager.SetID(approvalsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 approvalsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 approvals = new Approvals(item);
             }
         }
     }
     
 
     XmlNodeList masterConfirmationDateNodeList = xmlNode.SelectNodes("masterConfirmationDate");
     if (masterConfirmationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in masterConfirmationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 masterConfirmationDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(masterConfirmationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 masterConfirmationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 masterConfirmationDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList relatedPartyNodeList = xmlNode.SelectNodes("relatedParty");
     
     foreach (XmlNode item in relatedPartyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 relatedPartyIDRef = item.Attributes["id"].Name;
                 List<RelatedParty> ob = new List<RelatedParty>();
                 ob.Add(new RelatedParty(item));
                 IDManager.SetID(relatedPartyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 relatedPartyIDRef = item.Attributes["href"].Name;
             }
             else
             {
             relatedParty.Add(new RelatedParty(item));
             }
         }
     }
     
 
 }
Example #35
0
        public RelatedParty(XmlNode xmlNode)
        {
            XmlNodeList partyReferenceNodeList = xmlNode.SelectNodes("partyReference");

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

            foreach (XmlNode item in partyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        partyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(partyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        partyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        partyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList accountReferenceNodeList = xmlNode.SelectNodes("accountReference");

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

            foreach (XmlNode item in accountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        accountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(accountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        accountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        accountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList roleNodeList = xmlNode.SelectNodes("role");

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

            foreach (XmlNode item in roleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        roleIDRef = item.Attributes["id"].Name;
                        PartyRole ob = PartyRole();
                        IDManager.SetID(roleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        roleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        role = new PartyRole(item);
                    }
                }
            }


            XmlNodeList typeNodeList = xmlNode.SelectNodes("type");

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

            foreach (XmlNode item in typeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        typeIDRef = item.Attributes["id"].Name;
                        PartyRoleType ob = PartyRoleType();
                        IDManager.SetID(typeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        typeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        type = new PartyRoleType(item);
                    }
                }
            }
        }
        public ExtendibleProvision(XmlNode xmlNode)
        {
            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(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");

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

            foreach (XmlNode item in exerciseNoticeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseNoticeIDRef = item.Attributes["id"].Name;
                        ExerciseNotice ob = ExerciseNotice();
                        IDManager.SetID(exerciseNoticeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseNoticeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseNotice = 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 extendibleProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("extendibleProvisionAdjustedDates");

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

            foreach (XmlNode item in extendibleProvisionAdjustedDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        extendibleProvisionAdjustedDatesIDRef = item.Attributes["id"].Name;
                        ExtendibleProvisionAdjustedDates ob = ExtendibleProvisionAdjustedDates();
                        IDManager.SetID(extendibleProvisionAdjustedDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        extendibleProvisionAdjustedDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        extendibleProvisionAdjustedDates = new ExtendibleProvisionAdjustedDates(item);
                    }
                }
            }
        }
 public ExerciseFee(XmlNode xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode notionalReferenceNode = xmlNode.SelectSingleNode("notionalReference");
     
     if (notionalReferenceNode != null)
     {
         if (notionalReferenceNode.Attributes["href"] != null || notionalReferenceNode.Attributes["id"] != null) 
         {
             if (notionalReferenceNode.Attributes["id"] != null) 
             {
                 notionalReferenceIDRef_ = notionalReferenceNode.Attributes["id"].Value;
                 NotionalReference ob = new NotionalReference(notionalReferenceNode);
                 IDManager.SetID(notionalReferenceIDRef_, ob);
             }
             else if (notionalReferenceNode.Attributes["href"] != null)
             {
                 notionalReferenceIDRef_ = notionalReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 notionalReference_ = new NotionalReference(notionalReferenceNode);
             }
         }
         else
         {
             notionalReference_ = new NotionalReference(notionalReferenceNode);
         }
     }
     
 
     XmlNode feeAmountNode = xmlNode.SelectSingleNode("feeAmount");
     
     if (feeAmountNode != null)
     {
         if (feeAmountNode.Attributes["href"] != null || feeAmountNode.Attributes["id"] != null) 
         {
             if (feeAmountNode.Attributes["id"] != null) 
             {
                 feeAmountIDRef_ = feeAmountNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(feeAmountNode);
                 IDManager.SetID(feeAmountIDRef_, ob);
             }
             else if (feeAmountNode.Attributes["href"] != null)
             {
                 feeAmountIDRef_ = feeAmountNode.Attributes["href"].Value;
             }
             else
             {
                 feeAmount_ = new XsdTypeDecimal(feeAmountNode);
             }
         }
         else
         {
             feeAmount_ = new XsdTypeDecimal(feeAmountNode);
         }
     }
     
 
     XmlNode feeRateNode = xmlNode.SelectSingleNode("feeRate");
     
     if (feeRateNode != null)
     {
         if (feeRateNode.Attributes["href"] != null || feeRateNode.Attributes["id"] != null) 
         {
             if (feeRateNode.Attributes["id"] != null) 
             {
                 feeRateIDRef_ = feeRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(feeRateNode);
                 IDManager.SetID(feeRateIDRef_, ob);
             }
             else if (feeRateNode.Attributes["href"] != null)
             {
                 feeRateIDRef_ = feeRateNode.Attributes["href"].Value;
             }
             else
             {
                 feeRate_ = new XsdTypeDecimal(feeRateNode);
             }
         }
         else
         {
             feeRate_ = new XsdTypeDecimal(feeRateNode);
         }
     }
     
 
     XmlNode feePaymentDateNode = xmlNode.SelectSingleNode("feePaymentDate");
     
     if (feePaymentDateNode != null)
     {
         if (feePaymentDateNode.Attributes["href"] != null || feePaymentDateNode.Attributes["id"] != null) 
         {
             if (feePaymentDateNode.Attributes["id"] != null) 
             {
                 feePaymentDateIDRef_ = feePaymentDateNode.Attributes["id"].Value;
                 RelativeDateOffset ob = new RelativeDateOffset(feePaymentDateNode);
                 IDManager.SetID(feePaymentDateIDRef_, ob);
             }
             else if (feePaymentDateNode.Attributes["href"] != null)
             {
                 feePaymentDateIDRef_ = feePaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 feePaymentDate_ = new RelativeDateOffset(feePaymentDateNode);
             }
         }
         else
         {
             feePaymentDate_ = new RelativeDateOffset(feePaymentDateNode);
         }
     }
     
 
 }
        public ExerciseFee(XmlNode xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList notionalReferenceNodeList = xmlNode.SelectNodes("notionalReference");

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

            foreach (XmlNode item in notionalReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        notionalReferenceIDRef = item.Attributes["id"].Name;
                        NotionalReference ob = NotionalReference();
                        IDManager.SetID(notionalReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        notionalReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        notionalReference = new NotionalReference(item);
                    }
                }
            }


            XmlNodeList feeAmountNodeList = xmlNode.SelectNodes("feeAmount");

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

            foreach (XmlNode item in feeAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        feeAmountIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(feeAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        feeAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        feeAmount = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList feeRateNodeList = xmlNode.SelectNodes("feeRate");

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

            foreach (XmlNode item in feeRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        feeRateIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(feeRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        feeRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        feeRate = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList feePaymentDateNodeList = xmlNode.SelectNodes("feePaymentDate");

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

            foreach (XmlNode item in feePaymentDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        feePaymentDateIDRef = item.Attributes["id"].Name;
                        RelativeDateOffset ob = RelativeDateOffset();
                        IDManager.SetID(feePaymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        feePaymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        feePaymentDate = new RelativeDateOffset(item);
                    }
                }
            }
        }
 public GeneralTerms(XmlNode xmlNode)
 {
     XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");
     
     if (effectiveDateNode != null)
     {
         if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) 
         {
             if (effectiveDateNode.Attributes["id"] != null) 
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                 AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode);
                 IDManager.SetID(effectiveDateIDRef_, ob);
             }
             else if (effectiveDateNode.Attributes["href"] != null)
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 effectiveDate_ = new AdjustableDate2(effectiveDateNode);
             }
         }
         else
         {
             effectiveDate_ = new AdjustableDate2(effectiveDateNode);
         }
     }
     
 
     XmlNode scheduledTerminationDateNode = xmlNode.SelectSingleNode("scheduledTerminationDate");
     
     if (scheduledTerminationDateNode != null)
     {
         if (scheduledTerminationDateNode.Attributes["href"] != null || scheduledTerminationDateNode.Attributes["id"] != null) 
         {
             if (scheduledTerminationDateNode.Attributes["id"] != null) 
             {
                 scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["id"].Value;
                 AdjustableDate2 ob = new AdjustableDate2(scheduledTerminationDateNode);
                 IDManager.SetID(scheduledTerminationDateIDRef_, ob);
             }
             else if (scheduledTerminationDateNode.Attributes["href"] != null)
             {
                 scheduledTerminationDateIDRef_ = scheduledTerminationDateNode.Attributes["href"].Value;
             }
             else
             {
                 scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode);
             }
         }
         else
         {
             scheduledTerminationDate_ = new AdjustableDate2(scheduledTerminationDateNode);
         }
     }
     
 
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNode dateAdjustmentsNode = xmlNode.SelectSingleNode("dateAdjustments");
     
     if (dateAdjustmentsNode != null)
     {
         if (dateAdjustmentsNode.Attributes["href"] != null || dateAdjustmentsNode.Attributes["id"] != null) 
         {
             if (dateAdjustmentsNode.Attributes["id"] != null) 
             {
                 dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["id"].Value;
                 BusinessDayAdjustments ob = new BusinessDayAdjustments(dateAdjustmentsNode);
                 IDManager.SetID(dateAdjustmentsIDRef_, ob);
             }
             else if (dateAdjustmentsNode.Attributes["href"] != null)
             {
                 dateAdjustmentsIDRef_ = dateAdjustmentsNode.Attributes["href"].Value;
             }
             else
             {
                 dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode);
             }
         }
         else
         {
             dateAdjustments_ = new BusinessDayAdjustments(dateAdjustmentsNode);
         }
     }
     
 
     XmlNode referenceInformationNode = xmlNode.SelectSingleNode("referenceInformation");
     
     if (referenceInformationNode != null)
     {
         if (referenceInformationNode.Attributes["href"] != null || referenceInformationNode.Attributes["id"] != null) 
         {
             if (referenceInformationNode.Attributes["id"] != null) 
             {
                 referenceInformationIDRef_ = referenceInformationNode.Attributes["id"].Value;
                 ReferenceInformation ob = new ReferenceInformation(referenceInformationNode);
                 IDManager.SetID(referenceInformationIDRef_, ob);
             }
             else if (referenceInformationNode.Attributes["href"] != null)
             {
                 referenceInformationIDRef_ = referenceInformationNode.Attributes["href"].Value;
             }
             else
             {
                 referenceInformation_ = new ReferenceInformation(referenceInformationNode);
             }
         }
         else
         {
             referenceInformation_ = new ReferenceInformation(referenceInformationNode);
         }
     }
     
 
     XmlNode indexReferenceInformationNode = xmlNode.SelectSingleNode("indexReferenceInformation");
     
     if (indexReferenceInformationNode != null)
     {
         if (indexReferenceInformationNode.Attributes["href"] != null || indexReferenceInformationNode.Attributes["id"] != null) 
         {
             if (indexReferenceInformationNode.Attributes["id"] != null) 
             {
                 indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["id"].Value;
                 IndexReferenceInformation ob = new IndexReferenceInformation(indexReferenceInformationNode);
                 IDManager.SetID(indexReferenceInformationIDRef_, ob);
             }
             else if (indexReferenceInformationNode.Attributes["href"] != null)
             {
                 indexReferenceInformationIDRef_ = indexReferenceInformationNode.Attributes["href"].Value;
             }
             else
             {
                 indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode);
             }
         }
         else
         {
             indexReferenceInformation_ = new IndexReferenceInformation(indexReferenceInformationNode);
         }
     }
     
 
     XmlNode basketReferenceInformationNode = xmlNode.SelectSingleNode("basketReferenceInformation");
     
     if (basketReferenceInformationNode != null)
     {
         if (basketReferenceInformationNode.Attributes["href"] != null || basketReferenceInformationNode.Attributes["id"] != null) 
         {
             if (basketReferenceInformationNode.Attributes["id"] != null) 
             {
                 basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["id"].Value;
                 BasketReferenceInformation ob = new BasketReferenceInformation(basketReferenceInformationNode);
                 IDManager.SetID(basketReferenceInformationIDRef_, ob);
             }
             else if (basketReferenceInformationNode.Attributes["href"] != null)
             {
                 basketReferenceInformationIDRef_ = basketReferenceInformationNode.Attributes["href"].Value;
             }
             else
             {
                 basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode);
             }
         }
         else
         {
             basketReferenceInformation_ = new BasketReferenceInformation(basketReferenceInformationNode);
         }
     }
     
 
     XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm");
     
     if (additionalTermNodeList != null)
     {
         this.additionalTerm_ = new List<AdditionalTerm>();
         foreach (XmlNode item in additionalTermNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     additionalTermIDRef_ = item.Attributes["id"].Value;
                     additionalTerm_.Add(new AdditionalTerm(item));
                     IDManager.SetID(additionalTermIDRef_, additionalTerm_[additionalTerm_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     additionalTermIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 additionalTerm_.Add(new AdditionalTerm(item));
                 }
             }
             else
             {
                 additionalTerm_.Add(new AdditionalTerm(item));
             }
         }
     }
     
 
     XmlNode substitutionNode = xmlNode.SelectSingleNode("substitution");
     
     if (substitutionNode != null)
     {
         if (substitutionNode.Attributes["href"] != null || substitutionNode.Attributes["id"] != null) 
         {
             if (substitutionNode.Attributes["id"] != null) 
             {
                 substitutionIDRef_ = substitutionNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(substitutionNode);
                 IDManager.SetID(substitutionIDRef_, ob);
             }
             else if (substitutionNode.Attributes["href"] != null)
             {
                 substitutionIDRef_ = substitutionNode.Attributes["href"].Value;
             }
             else
             {
                 substitution_ = new XsdTypeBoolean(substitutionNode);
             }
         }
         else
         {
             substitution_ = new XsdTypeBoolean(substitutionNode);
         }
     }
     
 
     XmlNode modifiedEquityDeliveryNode = xmlNode.SelectSingleNode("modifiedEquityDelivery");
     
     if (modifiedEquityDeliveryNode != null)
     {
         if (modifiedEquityDeliveryNode.Attributes["href"] != null || modifiedEquityDeliveryNode.Attributes["id"] != null) 
         {
             if (modifiedEquityDeliveryNode.Attributes["id"] != null) 
             {
                 modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(modifiedEquityDeliveryNode);
                 IDManager.SetID(modifiedEquityDeliveryIDRef_, ob);
             }
             else if (modifiedEquityDeliveryNode.Attributes["href"] != null)
             {
                 modifiedEquityDeliveryIDRef_ = modifiedEquityDeliveryNode.Attributes["href"].Value;
             }
             else
             {
                 modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode);
             }
         }
         else
         {
             modifiedEquityDelivery_ = new XsdTypeBoolean(modifiedEquityDeliveryNode);
         }
     }
     
 
 }
 public TradeUnderlyer2(XmlNode xmlNode)
 {
     XmlNodeList floatingRateNodeList = xmlNode.SelectNodes("floatingRate");
     if (floatingRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in floatingRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 floatingRateIDRef = item.Attributes["id"].Name;
                 FloatingRate ob = FloatingRate();
                 IDManager.SetID(floatingRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 floatingRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 floatingRate = new FloatingRate(item);
             }
         }
     }
     
 
     XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");
     if (fixedRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedRateIDRef = item.Attributes["id"].Name;
                 Schedule ob = Schedule();
                 IDManager.SetID(fixedRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedRate = new Schedule(item);
             }
         }
     }
     
 
     XmlNodeList underlyingAssetNodeList = xmlNode.SelectNodes("underlyingAsset");
     if (underlyingAssetNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in underlyingAssetNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 underlyingAssetIDRef = item.Attributes["id"].Name;
                 Asset ob = Asset();
                 IDManager.SetID(underlyingAssetIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 underlyingAssetIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 underlyingAsset = new Asset(item);
             }
         }
     }
     
 
     XmlNodeList basketNodeList = xmlNode.SelectNodes("basket");
     if (basketNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in basketNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 basketIDRef = item.Attributes["id"].Name;
                 Basket ob = Basket();
                 IDManager.SetID(basketIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 basketIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 basket = new Basket(item);
             }
         }
     }
     
 
     XmlNodeList bondNodeList = xmlNode.SelectNodes("bond");
     if (bondNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in bondNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 bondIDRef = item.Attributes["id"].Name;
                 Bond ob = Bond();
                 IDManager.SetID(bondIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 bondIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 bond = new Bond(item);
             }
         }
     }
     
 
     XmlNodeList cashNodeList = xmlNode.SelectNodes("cash");
     if (cashNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashIDRef = item.Attributes["id"].Name;
                 Cash ob = Cash();
                 IDManager.SetID(cashIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cash = new Cash(item);
             }
         }
     }
     
 
     XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");
     if (commodityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityIDRef = item.Attributes["id"].Name;
                 Commodity ob = Commodity();
                 IDManager.SetID(commodityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodity = new Commodity(item);
             }
         }
     }
     
 
     XmlNodeList convertibleBondNodeList = xmlNode.SelectNodes("convertibleBond");
     if (convertibleBondNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in convertibleBondNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 convertibleBondIDRef = item.Attributes["id"].Name;
                 ConvertibleBond ob = ConvertibleBond();
                 IDManager.SetID(convertibleBondIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 convertibleBondIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 convertibleBond = new ConvertibleBond(item);
             }
         }
     }
     
 
     XmlNodeList equityNodeList = xmlNode.SelectNodes("equity");
     if (equityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityIDRef = item.Attributes["id"].Name;
                 EquityAsset ob = EquityAsset();
                 IDManager.SetID(equityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equity = new EquityAsset(item);
             }
         }
     }
     
 
     XmlNodeList exchangeTradedFundNodeList = xmlNode.SelectNodes("exchangeTradedFund");
     if (exchangeTradedFundNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeTradedFundNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeTradedFundIDRef = item.Attributes["id"].Name;
                 ExchangeTradedFund ob = ExchangeTradedFund();
                 IDManager.SetID(exchangeTradedFundIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeTradedFundIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeTradedFund = new ExchangeTradedFund(item);
             }
         }
     }
     
 
     XmlNodeList futureNodeList = xmlNode.SelectNodes("future");
     if (futureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in futureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 futureIDRef = item.Attributes["id"].Name;
                 Future ob = Future();
                 IDManager.SetID(futureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 futureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 future = new Future(item);
             }
         }
     }
     
 
     XmlNodeList indexNodeList = xmlNode.SelectNodes("index");
     if (indexNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in indexNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 indexIDRef = item.Attributes["id"].Name;
                 Index ob = Index();
                 IDManager.SetID(indexIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 indexIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 index = new Index(item);
             }
         }
     }
     
 
     XmlNodeList loanNodeList = xmlNode.SelectNodes("loan");
     if (loanNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in loanNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 loanIDRef = item.Attributes["id"].Name;
                 Loan ob = Loan();
                 IDManager.SetID(loanIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 loanIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 loan = new Loan(item);
             }
         }
     }
     
 
     XmlNodeList mortgageNodeList = xmlNode.SelectNodes("mortgage");
     if (mortgageNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in mortgageNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 mortgageIDRef = item.Attributes["id"].Name;
                 Mortgage ob = Mortgage();
                 IDManager.SetID(mortgageIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 mortgageIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 mortgage = new Mortgage(item);
             }
         }
     }
     
 
     XmlNodeList mutualFundNodeList = xmlNode.SelectNodes("mutualFund");
     if (mutualFundNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in mutualFundNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 mutualFundIDRef = item.Attributes["id"].Name;
                 MutualFund ob = MutualFund();
                 IDManager.SetID(mutualFundIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 mutualFundIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 mutualFund = new MutualFund(item);
             }
         }
     }
     
 
     XmlNodeList quotedCurrencyPairNodeList = xmlNode.SelectNodes("quotedCurrencyPair");
     if (quotedCurrencyPairNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in quotedCurrencyPairNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quotedCurrencyPairIDRef = item.Attributes["id"].Name;
                 QuotedCurrencyPair ob = QuotedCurrencyPair();
                 IDManager.SetID(quotedCurrencyPairIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quotedCurrencyPairIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 quotedCurrencyPair = new QuotedCurrencyPair(item);
             }
         }
     }
     
 
     XmlNodeList referenceEntityNodeList = xmlNode.SelectNodes("referenceEntity");
     if (referenceEntityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceEntityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceEntityIDRef = item.Attributes["id"].Name;
                 LegalEntity ob = LegalEntity();
                 IDManager.SetID(referenceEntityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceEntityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceEntity = new LegalEntity(item);
             }
         }
     }
     
 
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
 }
 public ExerciseFeeSchedule(XmlNode xmlNode)
 {
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList notionalReferenceNodeList = xmlNode.SelectNodes("notionalReference");
     if (notionalReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalReferenceIDRef = item.Attributes["id"].Name;
                 ScheduleReference ob = ScheduleReference();
                 IDManager.SetID(notionalReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalReference = new ScheduleReference(item);
             }
         }
     }
     
 
     XmlNodeList feeAmountScheduleNodeList = xmlNode.SelectNodes("feeAmountSchedule");
     if (feeAmountScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in feeAmountScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 feeAmountScheduleIDRef = item.Attributes["id"].Name;
                 AmountSchedule ob = AmountSchedule();
                 IDManager.SetID(feeAmountScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 feeAmountScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feeAmountSchedule = new AmountSchedule(item);
             }
         }
     }
     
 
     XmlNodeList feeRateScheduleNodeList = xmlNode.SelectNodes("feeRateSchedule");
     if (feeRateScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in feeRateScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 feeRateScheduleIDRef = item.Attributes["id"].Name;
                 Schedule ob = Schedule();
                 IDManager.SetID(feeRateScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 feeRateScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feeRateSchedule = new Schedule(item);
             }
         }
     }
     
 
     XmlNodeList feePaymentDateNodeList = xmlNode.SelectNodes("feePaymentDate");
     if (feePaymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in feePaymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 feePaymentDateIDRef = item.Attributes["id"].Name;
                 RelativeDateOffset ob = RelativeDateOffset();
                 IDManager.SetID(feePaymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 feePaymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feePaymentDate = new RelativeDateOffset(item);
             }
         }
     }
     
 
 }
 public ExtendibleProvision(XmlNode xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(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");
     if (exerciseNoticeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseNoticeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseNoticeIDRef = item.Attributes["id"].Name;
                 ExerciseNotice ob = ExerciseNotice();
                 IDManager.SetID(exerciseNoticeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseNoticeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseNotice = 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 extendibleProvisionAdjustedDatesNodeList = xmlNode.SelectNodes("extendibleProvisionAdjustedDates");
     if (extendibleProvisionAdjustedDatesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in extendibleProvisionAdjustedDatesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 extendibleProvisionAdjustedDatesIDRef = item.Attributes["id"].Name;
                 ExtendibleProvisionAdjustedDates ob = ExtendibleProvisionAdjustedDates();
                 IDManager.SetID(extendibleProvisionAdjustedDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 extendibleProvisionAdjustedDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 extendibleProvisionAdjustedDates = new ExtendibleProvisionAdjustedDates(item);
             }
         }
     }
     
 
 }
 public EquityPremium(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");
     if (payerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(payerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");
     if (payerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in payerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(payerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 payerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");
     if (receiverPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(receiverPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");
     if (receiverAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in receiverAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(receiverAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 receiverAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 receiverAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList premiumTypeNodeList = xmlNode.SelectNodes("premiumType");
     if (premiumTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in premiumTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 premiumTypeIDRef = item.Attributes["id"].Name;
                 PremiumTypeEnum ob = PremiumTypeEnum();
                 IDManager.SetID(premiumTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 premiumType = new PremiumTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList paymentAmountNodeList = xmlNode.SelectNodes("paymentAmount");
     if (paymentAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(paymentAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList paymentDateNodeList = xmlNode.SelectNodes("paymentDate");
     if (paymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDateIDRef = item.Attributes["id"].Name;
                 AdjustableDate ob = AdjustableDate();
                 IDManager.SetID(paymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDate = new AdjustableDate(item);
             }
         }
     }
     
 
     XmlNodeList swapPremiumNodeList = xmlNode.SelectNodes("swapPremium");
     if (swapPremiumNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in swapPremiumNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 swapPremiumIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(swapPremiumIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 swapPremiumIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 swapPremium = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList pricePerOptionNodeList = xmlNode.SelectNodes("pricePerOption");
     if (pricePerOptionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in pricePerOptionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 pricePerOptionIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(pricePerOptionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 pricePerOptionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 pricePerOption = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList percentageOfNotionalNodeList = xmlNode.SelectNodes("percentageOfNotional");
     if (percentageOfNotionalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in percentageOfNotionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 percentageOfNotionalIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(percentageOfNotionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 percentageOfNotionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 percentageOfNotional = new NonNegativeDecimal(item);
             }
         }
     }
     
 
 }
        public GrossCashflow(XmlNode xmlNode)
        {
            XmlNodeList cashflowIdNodeList = xmlNode.SelectNodes("cashflowId");

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

            foreach (XmlNode item in cashflowIdNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashflowIdIDRef = item.Attributes["id"].Name;
                        CashflowId ob = CashflowId();
                        IDManager.SetID(cashflowIdIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashflowIdIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashflowId = new CashflowId(item);
                    }
                }
            }


            XmlNodeList partyTradeIdentifierReferenceNodeList = xmlNode.SelectNodes("partyTradeIdentifierReference");

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

            foreach (XmlNode item in partyTradeIdentifierReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        partyTradeIdentifierReferenceIDRef = item.Attributes["id"].Name;
                        PartyTradeIdentifierReference ob = PartyTradeIdentifierReference();
                        IDManager.SetID(partyTradeIdentifierReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        partyTradeIdentifierReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        partyTradeIdentifierReference = new PartyTradeIdentifierReference(item);
                    }
                }
            }


            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList cashflowAmountNodeList = xmlNode.SelectNodes("cashflowAmount");

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

            foreach (XmlNode item in cashflowAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashflowAmountIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(cashflowAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashflowAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashflowAmount = new Money(item);
                    }
                }
            }


            XmlNodeList cashflowTypeNodeList = xmlNode.SelectNodes("cashflowType");

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

            foreach (XmlNode item in cashflowTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashflowTypeIDRef = item.Attributes["id"].Name;
                        CashflowType ob = CashflowType();
                        IDManager.SetID(cashflowTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashflowTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashflowType = new CashflowType(item);
                    }
                }
            }
        }
 public TradeIdentifier(XmlNode xmlNode)
 {
     XmlNode issuerNode = xmlNode.SelectSingleNode("issuer");
     
     if (issuerNode != null)
     {
         if (issuerNode.Attributes["href"] != null || issuerNode.Attributes["id"] != null) 
         {
             if (issuerNode.Attributes["id"] != null) 
             {
                 issuerIDRef_ = issuerNode.Attributes["id"].Value;
                 IssuerId ob = new IssuerId(issuerNode);
                 IDManager.SetID(issuerIDRef_, ob);
             }
             else if (issuerNode.Attributes["href"] != null)
             {
                 issuerIDRef_ = issuerNode.Attributes["href"].Value;
             }
             else
             {
                 issuer_ = new IssuerId(issuerNode);
             }
         }
         else
         {
             issuer_ = new IssuerId(issuerNode);
         }
     }
     
 
     XmlNode tradeIdNode = xmlNode.SelectSingleNode("tradeId");
     
     if (tradeIdNode != null)
     {
         if (tradeIdNode.Attributes["href"] != null || tradeIdNode.Attributes["id"] != null) 
         {
             if (tradeIdNode.Attributes["id"] != null) 
             {
                 tradeIdIDRef_ = tradeIdNode.Attributes["id"].Value;
                 TradeId ob = new TradeId(tradeIdNode);
                 IDManager.SetID(tradeIdIDRef_, ob);
             }
             else if (tradeIdNode.Attributes["href"] != null)
             {
                 tradeIdIDRef_ = tradeIdNode.Attributes["href"].Value;
             }
             else
             {
                 tradeId_ = new TradeId(tradeIdNode);
             }
         }
         else
         {
             tradeId_ = new TradeId(tradeIdNode);
         }
     }
     
 
     XmlNode partyReferenceNode = xmlNode.SelectSingleNode("partyReference");
     
     if (partyReferenceNode != null)
     {
         if (partyReferenceNode.Attributes["href"] != null || partyReferenceNode.Attributes["id"] != null) 
         {
             if (partyReferenceNode.Attributes["id"] != null) 
             {
                 partyReferenceIDRef_ = partyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(partyReferenceNode);
                 IDManager.SetID(partyReferenceIDRef_, ob);
             }
             else if (partyReferenceNode.Attributes["href"] != null)
             {
                 partyReferenceIDRef_ = partyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 partyReference_ = new PartyReference(partyReferenceNode);
             }
         }
         else
         {
             partyReference_ = new PartyReference(partyReferenceNode);
         }
     }
     
 
     XmlNode accountReferenceNode = xmlNode.SelectSingleNode("accountReference");
     
     if (accountReferenceNode != null)
     {
         if (accountReferenceNode.Attributes["href"] != null || accountReferenceNode.Attributes["id"] != null) 
         {
             if (accountReferenceNode.Attributes["id"] != null) 
             {
                 accountReferenceIDRef_ = accountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(accountReferenceNode);
                 IDManager.SetID(accountReferenceIDRef_, ob);
             }
             else if (accountReferenceNode.Attributes["href"] != null)
             {
                 accountReferenceIDRef_ = accountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 accountReference_ = new AccountReference(accountReferenceNode);
             }
         }
         else
         {
             accountReference_ = new AccountReference(accountReferenceNode);
         }
     }
     
 
     XmlNode versionedTradeIdNode = xmlNode.SelectSingleNode("versionedTradeId");
     
     if (versionedTradeIdNode != null)
     {
         if (versionedTradeIdNode.Attributes["href"] != null || versionedTradeIdNode.Attributes["id"] != null) 
         {
             if (versionedTradeIdNode.Attributes["id"] != null) 
             {
                 versionedTradeIdIDRef_ = versionedTradeIdNode.Attributes["id"].Value;
                 VersionedTradeId ob = new VersionedTradeId(versionedTradeIdNode);
                 IDManager.SetID(versionedTradeIdIDRef_, ob);
             }
             else if (versionedTradeIdNode.Attributes["href"] != null)
             {
                 versionedTradeIdIDRef_ = versionedTradeIdNode.Attributes["href"].Value;
             }
             else
             {
                 versionedTradeId_ = new VersionedTradeId(versionedTradeIdNode);
             }
         }
         else
         {
             versionedTradeId_ = new VersionedTradeId(versionedTradeIdNode);
         }
     }
     
 
 }
        public TradeUnderlyer2(XmlNode xmlNode)
        {
            XmlNodeList floatingRateNodeList = xmlNode.SelectNodes("floatingRate");

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

            foreach (XmlNode item in floatingRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        floatingRateIDRef = item.Attributes["id"].Name;
                        FloatingRate ob = FloatingRate();
                        IDManager.SetID(floatingRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        floatingRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        floatingRate = new FloatingRate(item);
                    }
                }
            }


            XmlNodeList fixedRateNodeList = xmlNode.SelectNodes("fixedRate");

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

            foreach (XmlNode item in fixedRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedRateIDRef = item.Attributes["id"].Name;
                        Schedule ob = Schedule();
                        IDManager.SetID(fixedRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedRate = new Schedule(item);
                    }
                }
            }


            XmlNodeList underlyingAssetNodeList = xmlNode.SelectNodes("underlyingAsset");

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

            foreach (XmlNode item in underlyingAssetNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        underlyingAssetIDRef = item.Attributes["id"].Name;
                        Asset ob = Asset();
                        IDManager.SetID(underlyingAssetIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        underlyingAssetIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        underlyingAsset = new Asset(item);
                    }
                }
            }


            XmlNodeList basketNodeList = xmlNode.SelectNodes("basket");

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

            foreach (XmlNode item in basketNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        basketIDRef = item.Attributes["id"].Name;
                        Basket ob = Basket();
                        IDManager.SetID(basketIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        basketIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        basket = new Basket(item);
                    }
                }
            }


            XmlNodeList bondNodeList = xmlNode.SelectNodes("bond");

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

            foreach (XmlNode item in bondNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        bondIDRef = item.Attributes["id"].Name;
                        Bond ob = Bond();
                        IDManager.SetID(bondIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        bondIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        bond = new Bond(item);
                    }
                }
            }


            XmlNodeList cashNodeList = xmlNode.SelectNodes("cash");

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

            foreach (XmlNode item in cashNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashIDRef = item.Attributes["id"].Name;
                        Cash ob = Cash();
                        IDManager.SetID(cashIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cash = new Cash(item);
                    }
                }
            }


            XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");

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

            foreach (XmlNode item in commodityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commodityIDRef = item.Attributes["id"].Name;
                        Commodity ob = Commodity();
                        IDManager.SetID(commodityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commodityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commodity = new Commodity(item);
                    }
                }
            }


            XmlNodeList convertibleBondNodeList = xmlNode.SelectNodes("convertibleBond");

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

            foreach (XmlNode item in convertibleBondNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        convertibleBondIDRef = item.Attributes["id"].Name;
                        ConvertibleBond ob = ConvertibleBond();
                        IDManager.SetID(convertibleBondIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        convertibleBondIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        convertibleBond = new ConvertibleBond(item);
                    }
                }
            }


            XmlNodeList equityNodeList = xmlNode.SelectNodes("equity");

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

            foreach (XmlNode item in equityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        equityIDRef = item.Attributes["id"].Name;
                        EquityAsset ob = EquityAsset();
                        IDManager.SetID(equityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        equityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        equity = new EquityAsset(item);
                    }
                }
            }


            XmlNodeList exchangeTradedFundNodeList = xmlNode.SelectNodes("exchangeTradedFund");

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

            foreach (XmlNode item in exchangeTradedFundNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangeTradedFundIDRef = item.Attributes["id"].Name;
                        ExchangeTradedFund ob = ExchangeTradedFund();
                        IDManager.SetID(exchangeTradedFundIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangeTradedFundIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangeTradedFund = new ExchangeTradedFund(item);
                    }
                }
            }


            XmlNodeList futureNodeList = xmlNode.SelectNodes("future");

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

            foreach (XmlNode item in futureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        futureIDRef = item.Attributes["id"].Name;
                        Future ob = Future();
                        IDManager.SetID(futureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        futureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        future = new Future(item);
                    }
                }
            }


            XmlNodeList indexNodeList = xmlNode.SelectNodes("index");

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

            foreach (XmlNode item in indexNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        indexIDRef = item.Attributes["id"].Name;
                        Index ob = Index();
                        IDManager.SetID(indexIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        indexIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        index = new Index(item);
                    }
                }
            }


            XmlNodeList loanNodeList = xmlNode.SelectNodes("loan");

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

            foreach (XmlNode item in loanNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        loanIDRef = item.Attributes["id"].Name;
                        Loan ob = Loan();
                        IDManager.SetID(loanIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        loanIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        loan = new Loan(item);
                    }
                }
            }


            XmlNodeList mortgageNodeList = xmlNode.SelectNodes("mortgage");

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

            foreach (XmlNode item in mortgageNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        mortgageIDRef = item.Attributes["id"].Name;
                        Mortgage ob = Mortgage();
                        IDManager.SetID(mortgageIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        mortgageIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        mortgage = new Mortgage(item);
                    }
                }
            }


            XmlNodeList mutualFundNodeList = xmlNode.SelectNodes("mutualFund");

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

            foreach (XmlNode item in mutualFundNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        mutualFundIDRef = item.Attributes["id"].Name;
                        MutualFund ob = MutualFund();
                        IDManager.SetID(mutualFundIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        mutualFundIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        mutualFund = new MutualFund(item);
                    }
                }
            }


            XmlNodeList quotedCurrencyPairNodeList = xmlNode.SelectNodes("quotedCurrencyPair");

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

            foreach (XmlNode item in quotedCurrencyPairNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef = item.Attributes["id"].Name;
                        QuotedCurrencyPair ob = QuotedCurrencyPair();
                        IDManager.SetID(quotedCurrencyPairIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quotedCurrencyPairIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quotedCurrencyPair = new QuotedCurrencyPair(item);
                    }
                }
            }


            XmlNodeList referenceEntityNodeList = xmlNode.SelectNodes("referenceEntity");

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

            foreach (XmlNode item in referenceEntityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        referenceEntityIDRef = item.Attributes["id"].Name;
                        LegalEntity ob = LegalEntity();
                        IDManager.SetID(referenceEntityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        referenceEntityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        referenceEntity = new LegalEntity(item);
                    }
                }
            }


            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }
        }
 public CommodityOption(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType");
     
     if (optionTypeNode != null)
     {
         if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) 
         {
             if (optionTypeNode.Attributes["id"] != null) 
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value;
                 PutCallEnum ob = new PutCallEnum(optionTypeNode);
                 IDManager.SetID(optionTypeIDRef_, ob);
             }
             else if (optionTypeNode.Attributes["href"] != null)
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 optionType_ = new PutCallEnum(optionTypeNode);
             }
         }
         else
         {
             optionType_ = new PutCallEnum(optionTypeNode);
         }
     }
     
 
     XmlNode commodityNode = xmlNode.SelectSingleNode("commodity");
     
     if (commodityNode != null)
     {
         if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) 
         {
             if (commodityNode.Attributes["id"] != null) 
             {
                 commodityIDRef_ = commodityNode.Attributes["id"].Value;
                 Commodity ob = new Commodity(commodityNode);
                 IDManager.SetID(commodityIDRef_, ob);
             }
             else if (commodityNode.Attributes["href"] != null)
             {
                 commodityIDRef_ = commodityNode.Attributes["href"].Value;
             }
             else
             {
                 commodity_ = new Commodity(commodityNode);
             }
         }
         else
         {
             commodity_ = new Commodity(commodityNode);
         }
     }
     
 
     XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");
     
     if (effectiveDateNode != null)
     {
         if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) 
         {
             if (effectiveDateNode.Attributes["id"] != null) 
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(effectiveDateNode);
                 IDManager.SetID(effectiveDateIDRef_, ob);
             }
             else if (effectiveDateNode.Attributes["href"] != null)
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
             }
         }
         else
         {
             effectiveDate_ = new AdjustableOrRelativeDate(effectiveDateNode);
         }
     }
     
 
     XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate");
     
     if (terminationDateNode != null)
     {
         if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) 
         {
             if (terminationDateNode.Attributes["id"] != null) 
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(terminationDateNode);
                 IDManager.SetID(terminationDateIDRef_, ob);
             }
             else if (terminationDateNode.Attributes["href"] != null)
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value;
             }
             else
             {
                 terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
             }
         }
         else
         {
             terminationDate_ = new AdjustableOrRelativeDate(terminationDateNode);
         }
     }
     
 
     XmlNode calculationPeriodsScheduleNode = xmlNode.SelectSingleNode("calculationPeriodsSchedule");
     
     if (calculationPeriodsScheduleNode != null)
     {
         if (calculationPeriodsScheduleNode.Attributes["href"] != null || calculationPeriodsScheduleNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsScheduleNode.Attributes["id"] != null) 
             {
                 calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["id"].Value;
                 CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
                 IDManager.SetID(calculationPeriodsScheduleIDRef_, ob);
             }
             else if (calculationPeriodsScheduleNode.Attributes["href"] != null)
             {
                 calculationPeriodsScheduleIDRef_ = calculationPeriodsScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
             }
         }
         else
         {
             calculationPeriodsSchedule_ = new CommodityCalculationPeriodsSchedule(calculationPeriodsScheduleNode);
         }
     }
     
 
     XmlNode calculationPeriodsNode = xmlNode.SelectSingleNode("calculationPeriods");
     
     if (calculationPeriodsNode != null)
     {
         if (calculationPeriodsNode.Attributes["href"] != null || calculationPeriodsNode.Attributes["id"] != null) 
         {
             if (calculationPeriodsNode.Attributes["id"] != null) 
             {
                 calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["id"].Value;
                 AdjustableDates ob = new AdjustableDates(calculationPeriodsNode);
                 IDManager.SetID(calculationPeriodsIDRef_, ob);
             }
             else if (calculationPeriodsNode.Attributes["href"] != null)
             {
                 calculationPeriodsIDRef_ = calculationPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriods_ = new AdjustableDates(calculationPeriodsNode);
             }
         }
         else
         {
             calculationPeriods_ = new AdjustableDates(calculationPeriodsNode);
         }
     }
     
 
     XmlNode pricingDatesNode = xmlNode.SelectSingleNode("pricingDates");
     
     if (pricingDatesNode != null)
     {
         if (pricingDatesNode.Attributes["href"] != null || pricingDatesNode.Attributes["id"] != null) 
         {
             if (pricingDatesNode.Attributes["id"] != null) 
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["id"].Value;
                 CommodityPricingDates ob = new CommodityPricingDates(pricingDatesNode);
                 IDManager.SetID(pricingDatesIDRef_, ob);
             }
             else if (pricingDatesNode.Attributes["href"] != null)
             {
                 pricingDatesIDRef_ = pricingDatesNode.Attributes["href"].Value;
             }
             else
             {
                 pricingDates_ = new CommodityPricingDates(pricingDatesNode);
             }
         }
         else
         {
             pricingDates_ = new CommodityPricingDates(pricingDatesNode);
         }
     }
     
 
     XmlNode averagingMethodNode = xmlNode.SelectSingleNode("averagingMethod");
     
     if (averagingMethodNode != null)
     {
         if (averagingMethodNode.Attributes["href"] != null || averagingMethodNode.Attributes["id"] != null) 
         {
             if (averagingMethodNode.Attributes["id"] != null) 
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["id"].Value;
                 AveragingMethodEnum ob = new AveragingMethodEnum(averagingMethodNode);
                 IDManager.SetID(averagingMethodIDRef_, ob);
             }
             else if (averagingMethodNode.Attributes["href"] != null)
             {
                 averagingMethodIDRef_ = averagingMethodNode.Attributes["href"].Value;
             }
             else
             {
                 averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
             }
         }
         else
         {
             averagingMethod_ = new AveragingMethodEnum(averagingMethodNode);
         }
     }
     
 
     XmlNode notionalQuantityScheduleNode = xmlNode.SelectSingleNode("notionalQuantitySchedule");
     
     if (notionalQuantityScheduleNode != null)
     {
         if (notionalQuantityScheduleNode.Attributes["href"] != null || notionalQuantityScheduleNode.Attributes["id"] != null) 
         {
             if (notionalQuantityScheduleNode.Attributes["id"] != null) 
             {
                 notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["id"].Value;
                 CommodityNotionalQuantitySchedule ob = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
                 IDManager.SetID(notionalQuantityScheduleIDRef_, ob);
             }
             else if (notionalQuantityScheduleNode.Attributes["href"] != null)
             {
                 notionalQuantityScheduleIDRef_ = notionalQuantityScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
             }
         }
         else
         {
             notionalQuantitySchedule_ = new CommodityNotionalQuantitySchedule(notionalQuantityScheduleNode);
         }
     }
     
 
     XmlNode notionalQuantityNode = xmlNode.SelectSingleNode("notionalQuantity");
     
     if (notionalQuantityNode != null)
     {
         if (notionalQuantityNode.Attributes["href"] != null || notionalQuantityNode.Attributes["id"] != null) 
         {
             if (notionalQuantityNode.Attributes["id"] != null) 
             {
                 notionalQuantityIDRef_ = notionalQuantityNode.Attributes["id"].Value;
                 CommodityNotionalQuantity ob = new CommodityNotionalQuantity(notionalQuantityNode);
                 IDManager.SetID(notionalQuantityIDRef_, ob);
             }
             else if (notionalQuantityNode.Attributes["href"] != null)
             {
                 notionalQuantityIDRef_ = notionalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode);
             }
         }
         else
         {
             notionalQuantity_ = new CommodityNotionalQuantity(notionalQuantityNode);
         }
     }
     
 
     XmlNodeList settlementPeriodsNotionalQuantityNodeList = xmlNode.SelectNodes("settlementPeriodsNotionalQuantity");
     
     if (settlementPeriodsNotionalQuantityNodeList != null)
     {
         this.settlementPeriodsNotionalQuantity_ = new List<CommoditySettlementPeriodsNotionalQuantity>();
         foreach (XmlNode item in settlementPeriodsNotionalQuantityNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["id"].Value;
                     settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                     IDManager.SetID(settlementPeriodsNotionalQuantityIDRef_, settlementPeriodsNotionalQuantity_[settlementPeriodsNotionalQuantity_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementPeriodsNotionalQuantityIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
                 }
             }
             else
             {
                 settlementPeriodsNotionalQuantity_.Add(new CommoditySettlementPeriodsNotionalQuantity(item));
             }
         }
     }
     
 
     XmlNode totalNotionalQuantityNode = xmlNode.SelectSingleNode("totalNotionalQuantity");
     
     if (totalNotionalQuantityNode != null)
     {
         if (totalNotionalQuantityNode.Attributes["href"] != null || totalNotionalQuantityNode.Attributes["id"] != null) 
         {
             if (totalNotionalQuantityNode.Attributes["id"] != null) 
             {
                 totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(totalNotionalQuantityNode);
                 IDManager.SetID(totalNotionalQuantityIDRef_, ob);
             }
             else if (totalNotionalQuantityNode.Attributes["href"] != null)
             {
                 totalNotionalQuantityIDRef_ = totalNotionalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode);
             }
         }
         else
         {
             totalNotionalQuantity_ = new XsdTypeDecimal(totalNotionalQuantityNode);
         }
     }
     
 
     XmlNode quantityReferenceNode = xmlNode.SelectSingleNode("quantityReference");
     
     if (quantityReferenceNode != null)
     {
         if (quantityReferenceNode.Attributes["href"] != null || quantityReferenceNode.Attributes["id"] != null) 
         {
             if (quantityReferenceNode.Attributes["id"] != null) 
             {
                 quantityReferenceIDRef_ = quantityReferenceNode.Attributes["id"].Value;
                 QuantityReference ob = new QuantityReference(quantityReferenceNode);
                 IDManager.SetID(quantityReferenceIDRef_, ob);
             }
             else if (quantityReferenceNode.Attributes["href"] != null)
             {
                 quantityReferenceIDRef_ = quantityReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 quantityReference_ = new QuantityReference(quantityReferenceNode);
             }
         }
         else
         {
             quantityReference_ = new QuantityReference(quantityReferenceNode);
         }
     }
     
 
     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;
                 CommodityExercise ob = new CommodityExercise(exerciseNode);
                 IDManager.SetID(exerciseIDRef_, ob);
             }
             else if (exerciseNode.Attributes["href"] != null)
             {
                 exerciseIDRef_ = exerciseNode.Attributes["href"].Value;
             }
             else
             {
                 exercise_ = new CommodityExercise(exerciseNode);
             }
         }
         else
         {
             exercise_ = new CommodityExercise(exerciseNode);
         }
     }
     
 
     XmlNode strikePricePerUnitNode = xmlNode.SelectSingleNode("strikePricePerUnit");
     
     if (strikePricePerUnitNode != null)
     {
         if (strikePricePerUnitNode.Attributes["href"] != null || strikePricePerUnitNode.Attributes["id"] != null) 
         {
             if (strikePricePerUnitNode.Attributes["id"] != null) 
             {
                 strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(strikePricePerUnitNode);
                 IDManager.SetID(strikePricePerUnitIDRef_, ob);
             }
             else if (strikePricePerUnitNode.Attributes["href"] != null)
             {
                 strikePricePerUnitIDRef_ = strikePricePerUnitNode.Attributes["href"].Value;
             }
             else
             {
                 strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode);
             }
         }
         else
         {
             strikePricePerUnit_ = new NonNegativeMoney(strikePricePerUnitNode);
         }
     }
     
 
     XmlNode strikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("strikePricePerUnitSchedule");
     
     if (strikePricePerUnitScheduleNode != null)
     {
         if (strikePricePerUnitScheduleNode.Attributes["href"] != null || strikePricePerUnitScheduleNode.Attributes["id"] != null) 
         {
             if (strikePricePerUnitScheduleNode.Attributes["id"] != null) 
             {
                 strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["id"].Value;
                 CommodityStrikeSchedule ob = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
                 IDManager.SetID(strikePricePerUnitScheduleIDRef_, ob);
             }
             else if (strikePricePerUnitScheduleNode.Attributes["href"] != null)
             {
                 strikePricePerUnitScheduleIDRef_ = strikePricePerUnitScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
             }
         }
         else
         {
             strikePricePerUnitSchedule_ = new CommodityStrikeSchedule(strikePricePerUnitScheduleNode);
         }
     }
     
 
     XmlNode floatingStrikePricePerUnitNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnit");
     
     if (floatingStrikePricePerUnitNode != null)
     {
         if (floatingStrikePricePerUnitNode.Attributes["href"] != null || floatingStrikePricePerUnitNode.Attributes["id"] != null) 
         {
             if (floatingStrikePricePerUnitNode.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["id"].Value;
                 FloatingStrikePrice ob = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
                 IDManager.SetID(floatingStrikePricePerUnitIDRef_, ob);
             }
             else if (floatingStrikePricePerUnitNode.Attributes["href"] != null)
             {
                 floatingStrikePricePerUnitIDRef_ = floatingStrikePricePerUnitNode.Attributes["href"].Value;
             }
             else
             {
                 floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
             }
         }
         else
         {
             floatingStrikePricePerUnit_ = new FloatingStrikePrice(floatingStrikePricePerUnitNode);
         }
     }
     
 
     XmlNode floatingStrikePricePerUnitScheduleNode = xmlNode.SelectSingleNode("floatingStrikePricePerUnitSchedule");
     
     if (floatingStrikePricePerUnitScheduleNode != null)
     {
         if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null || floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) 
         {
             if (floatingStrikePricePerUnitScheduleNode.Attributes["id"] != null) 
             {
                 floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["id"].Value;
                 CommodityCalculationPeriodsSchedule ob = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
                 IDManager.SetID(floatingStrikePricePerUnitScheduleIDRef_, ob);
             }
             else if (floatingStrikePricePerUnitScheduleNode.Attributes["href"] != null)
             {
                 floatingStrikePricePerUnitScheduleIDRef_ = floatingStrikePricePerUnitScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
             }
         }
         else
         {
             floatingStrikePricePerUnitSchedule_ = new CommodityCalculationPeriodsSchedule(floatingStrikePricePerUnitScheduleNode);
         }
     }
     
 
     XmlNode commoditySwapNode = xmlNode.SelectSingleNode("commoditySwap");
     
     if (commoditySwapNode != null)
     {
         if (commoditySwapNode.Attributes["href"] != null || commoditySwapNode.Attributes["id"] != null) 
         {
             if (commoditySwapNode.Attributes["id"] != null) 
             {
                 commoditySwapIDRef_ = commoditySwapNode.Attributes["id"].Value;
                 CommoditySwap ob = new CommoditySwap(commoditySwapNode);
                 IDManager.SetID(commoditySwapIDRef_, ob);
             }
             else if (commoditySwapNode.Attributes["href"] != null)
             {
                 commoditySwapIDRef_ = commoditySwapNode.Attributes["href"].Value;
             }
             else
             {
                 commoditySwap_ = new CommoditySwap(commoditySwapNode);
             }
         }
         else
         {
             commoditySwap_ = new CommoditySwap(commoditySwapNode);
         }
     }
     
 
     XmlNode commodityForwardNode = xmlNode.SelectSingleNode("commodityForward");
     
     if (commodityForwardNode != null)
     {
         if (commodityForwardNode.Attributes["href"] != null || commodityForwardNode.Attributes["id"] != null) 
         {
             if (commodityForwardNode.Attributes["id"] != null) 
             {
                 commodityForwardIDRef_ = commodityForwardNode.Attributes["id"].Value;
                 CommodityForward ob = new CommodityForward(commodityForwardNode);
                 IDManager.SetID(commodityForwardIDRef_, ob);
             }
             else if (commodityForwardNode.Attributes["href"] != null)
             {
                 commodityForwardIDRef_ = commodityForwardNode.Attributes["href"].Value;
             }
             else
             {
                 commodityForward_ = new CommodityForward(commodityForwardNode);
             }
         }
         else
         {
             commodityForward_ = new CommodityForward(commodityForwardNode);
         }
     }
     
 
     XmlNode physicalExerciseNode = xmlNode.SelectSingleNode("physicalExercise");
     
     if (physicalExerciseNode != null)
     {
         if (physicalExerciseNode.Attributes["href"] != null || physicalExerciseNode.Attributes["id"] != null) 
         {
             if (physicalExerciseNode.Attributes["id"] != null) 
             {
                 physicalExerciseIDRef_ = physicalExerciseNode.Attributes["id"].Value;
                 CommodityPhysicalExercise ob = new CommodityPhysicalExercise(physicalExerciseNode);
                 IDManager.SetID(physicalExerciseIDRef_, ob);
             }
             else if (physicalExerciseNode.Attributes["href"] != null)
             {
                 physicalExerciseIDRef_ = physicalExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
             }
         }
         else
         {
             physicalExercise_ = new CommodityPhysicalExercise(physicalExerciseNode);
         }
     }
     
 
     XmlNode weatherCalculationPeriodsNode = xmlNode.SelectSingleNode("weatherCalculationPeriods");
     
     if (weatherCalculationPeriodsNode != null)
     {
         if (weatherCalculationPeriodsNode.Attributes["href"] != null || weatherCalculationPeriodsNode.Attributes["id"] != null) 
         {
             if (weatherCalculationPeriodsNode.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["id"].Value;
                 WeatherCalculationPeriods ob = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
                 IDManager.SetID(weatherCalculationPeriodsIDRef_, ob);
             }
             else if (weatherCalculationPeriodsNode.Attributes["href"] != null)
             {
                 weatherCalculationPeriodsIDRef_ = weatherCalculationPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
             }
         }
         else
         {
             weatherCalculationPeriods_ = new WeatherCalculationPeriods(weatherCalculationPeriodsNode);
         }
     }
     
 
     XmlNode weatherCalculationPeriodsReferenceNode = xmlNode.SelectSingleNode("weatherCalculationPeriodsReference");
     
     if (weatherCalculationPeriodsReferenceNode != null)
     {
         if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null || weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) 
         {
             if (weatherCalculationPeriodsReferenceNode.Attributes["id"] != null) 
             {
                 weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["id"].Value;
                 CalculationPeriodsReference ob = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
                 IDManager.SetID(weatherCalculationPeriodsReferenceIDRef_, ob);
             }
             else if (weatherCalculationPeriodsReferenceNode.Attributes["href"] != null)
             {
                 weatherCalculationPeriodsReferenceIDRef_ = weatherCalculationPeriodsReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
             }
         }
         else
         {
             weatherCalculationPeriodsReference_ = new CalculationPeriodsReference(weatherCalculationPeriodsReferenceNode);
         }
     }
     
 
     XmlNode weatherNotionalAmountNode = xmlNode.SelectSingleNode("weatherNotionalAmount");
     
     if (weatherNotionalAmountNode != null)
     {
         if (weatherNotionalAmountNode.Attributes["href"] != null || weatherNotionalAmountNode.Attributes["id"] != null) 
         {
             if (weatherNotionalAmountNode.Attributes["id"] != null) 
             {
                 weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(weatherNotionalAmountNode);
                 IDManager.SetID(weatherNotionalAmountIDRef_, ob);
             }
             else if (weatherNotionalAmountNode.Attributes["href"] != null)
             {
                 weatherNotionalAmountIDRef_ = weatherNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode);
             }
         }
         else
         {
             weatherNotionalAmount_ = new NonNegativeMoney(weatherNotionalAmountNode);
         }
     }
     
 
     XmlNode weatherIndexStrikeLevelNode = xmlNode.SelectSingleNode("weatherIndexStrikeLevel");
     
     if (weatherIndexStrikeLevelNode != null)
     {
         if (weatherIndexStrikeLevelNode.Attributes["href"] != null || weatherIndexStrikeLevelNode.Attributes["id"] != null) 
         {
             if (weatherIndexStrikeLevelNode.Attributes["id"] != null) 
             {
                 weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["id"].Value;
                 WeatherIndex ob = new WeatherIndex(weatherIndexStrikeLevelNode);
                 IDManager.SetID(weatherIndexStrikeLevelIDRef_, ob);
             }
             else if (weatherIndexStrikeLevelNode.Attributes["href"] != null)
             {
                 weatherIndexStrikeLevelIDRef_ = weatherIndexStrikeLevelNode.Attributes["href"].Value;
             }
             else
             {
                 weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode);
             }
         }
         else
         {
             weatherIndexStrikeLevel_ = new WeatherIndex(weatherIndexStrikeLevelNode);
         }
     }
     
 
     XmlNode calculationNode = xmlNode.SelectSingleNode("calculation");
     
     if (calculationNode != null)
     {
         if (calculationNode.Attributes["href"] != null || calculationNode.Attributes["id"] != null) 
         {
             if (calculationNode.Attributes["id"] != null) 
             {
                 calculationIDRef_ = calculationNode.Attributes["id"].Value;
                 WeatherLegCalculation ob = new WeatherLegCalculation(calculationNode);
                 IDManager.SetID(calculationIDRef_, ob);
             }
             else if (calculationNode.Attributes["href"] != null)
             {
                 calculationIDRef_ = calculationNode.Attributes["href"].Value;
             }
             else
             {
                 calculation_ = new WeatherLegCalculation(calculationNode);
             }
         }
         else
         {
             calculation_ = new WeatherLegCalculation(calculationNode);
         }
     }
     
 
     XmlNode weatherIndexDataNode = xmlNode.SelectSingleNode("weatherIndexData");
     
     if (weatherIndexDataNode != null)
     {
         if (weatherIndexDataNode.Attributes["href"] != null || weatherIndexDataNode.Attributes["id"] != null) 
         {
             if (weatherIndexDataNode.Attributes["id"] != null) 
             {
                 weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["id"].Value;
                 WeatherIndexData ob = new WeatherIndexData(weatherIndexDataNode);
                 IDManager.SetID(weatherIndexDataIDRef_, ob);
             }
             else if (weatherIndexDataNode.Attributes["href"] != null)
             {
                 weatherIndexDataIDRef_ = weatherIndexDataNode.Attributes["href"].Value;
             }
             else
             {
                 weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode);
             }
         }
         else
         {
             weatherIndexData_ = new WeatherIndexData(weatherIndexDataNode);
         }
     }
     
 
     XmlNodeList premiumNodeList = xmlNode.SelectNodes("premium");
     
     if (premiumNodeList != null)
     {
         this.premium_ = new List<CommodityPremium>();
         foreach (XmlNode item in premiumNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     premiumIDRef_ = item.Attributes["id"].Value;
                     premium_.Add(new CommodityPremium(item));
                     IDManager.SetID(premiumIDRef_, premium_[premium_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     premiumIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 premium_.Add(new CommodityPremium(item));
                 }
             }
             else
             {
                 premium_.Add(new CommodityPremium(item));
             }
         }
     }
     
 
     XmlNode commonPricingNode = xmlNode.SelectSingleNode("commonPricing");
     
     if (commonPricingNode != null)
     {
         if (commonPricingNode.Attributes["href"] != null || commonPricingNode.Attributes["id"] != null) 
         {
             if (commonPricingNode.Attributes["id"] != null) 
             {
                 commonPricingIDRef_ = commonPricingNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(commonPricingNode);
                 IDManager.SetID(commonPricingIDRef_, ob);
             }
             else if (commonPricingNode.Attributes["href"] != null)
             {
                 commonPricingIDRef_ = commonPricingNode.Attributes["href"].Value;
             }
             else
             {
                 commonPricing_ = new XsdTypeBoolean(commonPricingNode);
             }
         }
         else
         {
             commonPricing_ = new XsdTypeBoolean(commonPricingNode);
         }
     }
     
 
     XmlNode marketDisruptionNode = xmlNode.SelectSingleNode("marketDisruption");
     
     if (marketDisruptionNode != null)
     {
         if (marketDisruptionNode.Attributes["href"] != null || marketDisruptionNode.Attributes["id"] != null) 
         {
             if (marketDisruptionNode.Attributes["id"] != null) 
             {
                 marketDisruptionIDRef_ = marketDisruptionNode.Attributes["id"].Value;
                 CommodityMarketDisruption ob = new CommodityMarketDisruption(marketDisruptionNode);
                 IDManager.SetID(marketDisruptionIDRef_, ob);
             }
             else if (marketDisruptionNode.Attributes["href"] != null)
             {
                 marketDisruptionIDRef_ = marketDisruptionNode.Attributes["href"].Value;
             }
             else
             {
                 marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
             }
         }
         else
         {
             marketDisruption_ = new CommodityMarketDisruption(marketDisruptionNode);
         }
     }
     
 
     XmlNode settlementDisruptionNode = xmlNode.SelectSingleNode("settlementDisruption");
     
     if (settlementDisruptionNode != null)
     {
         if (settlementDisruptionNode.Attributes["href"] != null || settlementDisruptionNode.Attributes["id"] != null) 
         {
             if (settlementDisruptionNode.Attributes["id"] != null) 
             {
                 settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["id"].Value;
                 CommodityBullionSettlementDisruptionEnum ob = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
                 IDManager.SetID(settlementDisruptionIDRef_, ob);
             }
             else if (settlementDisruptionNode.Attributes["href"] != null)
             {
                 settlementDisruptionIDRef_ = settlementDisruptionNode.Attributes["href"].Value;
             }
             else
             {
                 settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
             }
         }
         else
         {
             settlementDisruption_ = new CommodityBullionSettlementDisruptionEnum(settlementDisruptionNode);
         }
     }
     
 
     XmlNode roundingNode = xmlNode.SelectSingleNode("rounding");
     
     if (roundingNode != null)
     {
         if (roundingNode.Attributes["href"] != null || roundingNode.Attributes["id"] != null) 
         {
             if (roundingNode.Attributes["id"] != null) 
             {
                 roundingIDRef_ = roundingNode.Attributes["id"].Value;
                 Rounding ob = new Rounding(roundingNode);
                 IDManager.SetID(roundingIDRef_, ob);
             }
             else if (roundingNode.Attributes["href"] != null)
             {
                 roundingIDRef_ = roundingNode.Attributes["href"].Value;
             }
             else
             {
                 rounding_ = new Rounding(roundingNode);
             }
         }
         else
         {
             rounding_ = new Rounding(roundingNode);
         }
     }
     
 
 }
 public GrossCashflow(XmlNode xmlNode)
 {
     XmlNode cashflowIdNode = xmlNode.SelectSingleNode("cashflowId");
     
     if (cashflowIdNode != null)
     {
         if (cashflowIdNode.Attributes["href"] != null || cashflowIdNode.Attributes["id"] != null) 
         {
             if (cashflowIdNode.Attributes["id"] != null) 
             {
                 cashflowIdIDRef_ = cashflowIdNode.Attributes["id"].Value;
                 CashflowId ob = new CashflowId(cashflowIdNode);
                 IDManager.SetID(cashflowIdIDRef_, ob);
             }
             else if (cashflowIdNode.Attributes["href"] != null)
             {
                 cashflowIdIDRef_ = cashflowIdNode.Attributes["href"].Value;
             }
             else
             {
                 cashflowId_ = new CashflowId(cashflowIdNode);
             }
         }
         else
         {
             cashflowId_ = new CashflowId(cashflowIdNode);
         }
     }
     
 
     XmlNode partyTradeIdentifierReferenceNode = xmlNode.SelectSingleNode("partyTradeIdentifierReference");
     
     if (partyTradeIdentifierReferenceNode != null)
     {
         if (partyTradeIdentifierReferenceNode.Attributes["href"] != null || partyTradeIdentifierReferenceNode.Attributes["id"] != null) 
         {
             if (partyTradeIdentifierReferenceNode.Attributes["id"] != null) 
             {
                 partyTradeIdentifierReferenceIDRef_ = partyTradeIdentifierReferenceNode.Attributes["id"].Value;
                 PartyTradeIdentifierReference ob = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
                 IDManager.SetID(partyTradeIdentifierReferenceIDRef_, ob);
             }
             else if (partyTradeIdentifierReferenceNode.Attributes["href"] != null)
             {
                 partyTradeIdentifierReferenceIDRef_ = partyTradeIdentifierReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 partyTradeIdentifierReference_ = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
             }
         }
         else
         {
             partyTradeIdentifierReference_ = new PartyTradeIdentifierReference(partyTradeIdentifierReferenceNode);
         }
     }
     
 
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode cashflowAmountNode = xmlNode.SelectSingleNode("cashflowAmount");
     
     if (cashflowAmountNode != null)
     {
         if (cashflowAmountNode.Attributes["href"] != null || cashflowAmountNode.Attributes["id"] != null) 
         {
             if (cashflowAmountNode.Attributes["id"] != null) 
             {
                 cashflowAmountIDRef_ = cashflowAmountNode.Attributes["id"].Value;
                 Money ob = new Money(cashflowAmountNode);
                 IDManager.SetID(cashflowAmountIDRef_, ob);
             }
             else if (cashflowAmountNode.Attributes["href"] != null)
             {
                 cashflowAmountIDRef_ = cashflowAmountNode.Attributes["href"].Value;
             }
             else
             {
                 cashflowAmount_ = new Money(cashflowAmountNode);
             }
         }
         else
         {
             cashflowAmount_ = new Money(cashflowAmountNode);
         }
     }
     
 
     XmlNode cashflowTypeNode = xmlNode.SelectSingleNode("cashflowType");
     
     if (cashflowTypeNode != null)
     {
         if (cashflowTypeNode.Attributes["href"] != null || cashflowTypeNode.Attributes["id"] != null) 
         {
             if (cashflowTypeNode.Attributes["id"] != null) 
             {
                 cashflowTypeIDRef_ = cashflowTypeNode.Attributes["id"].Value;
                 CashflowType ob = new CashflowType(cashflowTypeNode);
                 IDManager.SetID(cashflowTypeIDRef_, ob);
             }
             else if (cashflowTypeNode.Attributes["href"] != null)
             {
                 cashflowTypeIDRef_ = cashflowTypeNode.Attributes["href"].Value;
             }
             else
             {
                 cashflowType_ = new CashflowType(cashflowTypeNode);
             }
         }
         else
         {
             cashflowType_ = new CashflowType(cashflowTypeNode);
         }
     }
     
 
 }
 public ForwardSale(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset");
     
     if (underlyingAssetNode != null)
     {
         if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) 
         {
             if (underlyingAssetNode.Attributes["id"] != null) 
             {
                 underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value;
                 Asset ob = new Asset(underlyingAssetNode);
                 IDManager.SetID(underlyingAssetIDRef_, ob);
             }
             else if (underlyingAssetNode.Attributes["href"] != null)
             {
                 underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value;
             }
             else
             {
                 underlyingAsset_ = new Asset(underlyingAssetNode);
             }
         }
         else
         {
             underlyingAsset_ = new Asset(underlyingAssetNode);
         }
     }
     
 
     XmlNode basketNode = xmlNode.SelectSingleNode("basket");
     
     if (basketNode != null)
     {
         if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) 
         {
             if (basketNode.Attributes["id"] != null) 
             {
                 basketIDRef_ = basketNode.Attributes["id"].Value;
                 Basket ob = new Basket(basketNode);
                 IDManager.SetID(basketIDRef_, ob);
             }
             else if (basketNode.Attributes["href"] != null)
             {
                 basketIDRef_ = basketNode.Attributes["href"].Value;
             }
             else
             {
                 basket_ = new Basket(basketNode);
             }
         }
         else
         {
             basket_ = new Basket(basketNode);
         }
     }
     
 
     XmlNode bondNode = xmlNode.SelectSingleNode("bond");
     
     if (bondNode != null)
     {
         if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) 
         {
             if (bondNode.Attributes["id"] != null) 
             {
                 bondIDRef_ = bondNode.Attributes["id"].Value;
                 Bond ob = new Bond(bondNode);
                 IDManager.SetID(bondIDRef_, ob);
             }
             else if (bondNode.Attributes["href"] != null)
             {
                 bondIDRef_ = bondNode.Attributes["href"].Value;
             }
             else
             {
                 bond_ = new Bond(bondNode);
             }
         }
         else
         {
             bond_ = new Bond(bondNode);
         }
     }
     
 
     XmlNode cashNode = xmlNode.SelectSingleNode("cash");
     
     if (cashNode != null)
     {
         if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) 
         {
             if (cashNode.Attributes["id"] != null) 
             {
                 cashIDRef_ = cashNode.Attributes["id"].Value;
                 Cash ob = new Cash(cashNode);
                 IDManager.SetID(cashIDRef_, ob);
             }
             else if (cashNode.Attributes["href"] != null)
             {
                 cashIDRef_ = cashNode.Attributes["href"].Value;
             }
             else
             {
                 cash_ = new Cash(cashNode);
             }
         }
         else
         {
             cash_ = new Cash(cashNode);
         }
     }
     
 
     XmlNode commodityNode = xmlNode.SelectSingleNode("commodity");
     
     if (commodityNode != null)
     {
         if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) 
         {
             if (commodityNode.Attributes["id"] != null) 
             {
                 commodityIDRef_ = commodityNode.Attributes["id"].Value;
                 Commodity ob = new Commodity(commodityNode);
                 IDManager.SetID(commodityIDRef_, ob);
             }
             else if (commodityNode.Attributes["href"] != null)
             {
                 commodityIDRef_ = commodityNode.Attributes["href"].Value;
             }
             else
             {
                 commodity_ = new Commodity(commodityNode);
             }
         }
         else
         {
             commodity_ = new Commodity(commodityNode);
         }
     }
     
 
     XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond");
     
     if (convertibleBondNode != null)
     {
         if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) 
         {
             if (convertibleBondNode.Attributes["id"] != null) 
             {
                 convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value;
                 ConvertibleBond ob = new ConvertibleBond(convertibleBondNode);
                 IDManager.SetID(convertibleBondIDRef_, ob);
             }
             else if (convertibleBondNode.Attributes["href"] != null)
             {
                 convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value;
             }
             else
             {
                 convertibleBond_ = new ConvertibleBond(convertibleBondNode);
             }
         }
         else
         {
             convertibleBond_ = new ConvertibleBond(convertibleBondNode);
         }
     }
     
 
     XmlNode equityNode = xmlNode.SelectSingleNode("equity");
     
     if (equityNode != null)
     {
         if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) 
         {
             if (equityNode.Attributes["id"] != null) 
             {
                 equityIDRef_ = equityNode.Attributes["id"].Value;
                 EquityAsset ob = new EquityAsset(equityNode);
                 IDManager.SetID(equityIDRef_, ob);
             }
             else if (equityNode.Attributes["href"] != null)
             {
                 equityIDRef_ = equityNode.Attributes["href"].Value;
             }
             else
             {
                 equity_ = new EquityAsset(equityNode);
             }
         }
         else
         {
             equity_ = new EquityAsset(equityNode);
         }
     }
     
 
     XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund");
     
     if (exchangeTradedFundNode != null)
     {
         if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) 
         {
             if (exchangeTradedFundNode.Attributes["id"] != null) 
             {
                 exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value;
                 ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode);
                 IDManager.SetID(exchangeTradedFundIDRef_, ob);
             }
             else if (exchangeTradedFundNode.Attributes["href"] != null)
             {
                 exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
             }
         }
         else
         {
             exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
         }
     }
     
 
     XmlNode futureNode = xmlNode.SelectSingleNode("future");
     
     if (futureNode != null)
     {
         if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) 
         {
             if (futureNode.Attributes["id"] != null) 
             {
                 futureIDRef_ = futureNode.Attributes["id"].Value;
                 Future ob = new Future(futureNode);
                 IDManager.SetID(futureIDRef_, ob);
             }
             else if (futureNode.Attributes["href"] != null)
             {
                 futureIDRef_ = futureNode.Attributes["href"].Value;
             }
             else
             {
                 future_ = new Future(futureNode);
             }
         }
         else
         {
             future_ = new Future(futureNode);
         }
     }
     
 
     XmlNode indexNode = xmlNode.SelectSingleNode("index");
     
     if (indexNode != null)
     {
         if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) 
         {
             if (indexNode.Attributes["id"] != null) 
             {
                 indexIDRef_ = indexNode.Attributes["id"].Value;
                 Index ob = new Index(indexNode);
                 IDManager.SetID(indexIDRef_, ob);
             }
             else if (indexNode.Attributes["href"] != null)
             {
                 indexIDRef_ = indexNode.Attributes["href"].Value;
             }
             else
             {
                 index_ = new Index(indexNode);
             }
         }
         else
         {
             index_ = new Index(indexNode);
         }
     }
     
 
     XmlNode loanNode = xmlNode.SelectSingleNode("loan");
     
     if (loanNode != null)
     {
         if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) 
         {
             if (loanNode.Attributes["id"] != null) 
             {
                 loanIDRef_ = loanNode.Attributes["id"].Value;
                 Loan ob = new Loan(loanNode);
                 IDManager.SetID(loanIDRef_, ob);
             }
             else if (loanNode.Attributes["href"] != null)
             {
                 loanIDRef_ = loanNode.Attributes["href"].Value;
             }
             else
             {
                 loan_ = new Loan(loanNode);
             }
         }
         else
         {
             loan_ = new Loan(loanNode);
         }
     }
     
 
     XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage");
     
     if (mortgageNode != null)
     {
         if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) 
         {
             if (mortgageNode.Attributes["id"] != null) 
             {
                 mortgageIDRef_ = mortgageNode.Attributes["id"].Value;
                 Mortgage ob = new Mortgage(mortgageNode);
                 IDManager.SetID(mortgageIDRef_, ob);
             }
             else if (mortgageNode.Attributes["href"] != null)
             {
                 mortgageIDRef_ = mortgageNode.Attributes["href"].Value;
             }
             else
             {
                 mortgage_ = new Mortgage(mortgageNode);
             }
         }
         else
         {
             mortgage_ = new Mortgage(mortgageNode);
         }
     }
     
 
     XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund");
     
     if (mutualFundNode != null)
     {
         if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) 
         {
             if (mutualFundNode.Attributes["id"] != null) 
             {
                 mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value;
                 MutualFund ob = new MutualFund(mutualFundNode);
                 IDManager.SetID(mutualFundIDRef_, ob);
             }
             else if (mutualFundNode.Attributes["href"] != null)
             {
                 mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value;
             }
             else
             {
                 mutualFund_ = new MutualFund(mutualFundNode);
             }
         }
         else
         {
             mutualFund_ = new MutualFund(mutualFundNode);
         }
     }
     
 
     XmlNode forwardSaleDateNode = xmlNode.SelectSingleNode("forwardSaleDate");
     
     if (forwardSaleDateNode != null)
     {
         if (forwardSaleDateNode.Attributes["href"] != null || forwardSaleDateNode.Attributes["id"] != null) 
         {
             if (forwardSaleDateNode.Attributes["id"] != null) 
             {
                 forwardSaleDateIDRef_ = forwardSaleDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(forwardSaleDateNode);
                 IDManager.SetID(forwardSaleDateIDRef_, ob);
             }
             else if (forwardSaleDateNode.Attributes["href"] != null)
             {
                 forwardSaleDateIDRef_ = forwardSaleDateNode.Attributes["href"].Value;
             }
             else
             {
                 forwardSaleDate_ = new XsdTypeDate(forwardSaleDateNode);
             }
         }
         else
         {
             forwardSaleDate_ = new XsdTypeDate(forwardSaleDateNode);
         }
     }
     
 
     XmlNode settlementNode = xmlNode.SelectSingleNode("settlement");
     
     if (settlementNode != null)
     {
         if (settlementNode.Attributes["href"] != null || settlementNode.Attributes["id"] != null) 
         {
             if (settlementNode.Attributes["id"] != null) 
             {
                 settlementIDRef_ = settlementNode.Attributes["id"].Value;
                 Payment ob = new Payment(settlementNode);
                 IDManager.SetID(settlementIDRef_, ob);
             }
             else if (settlementNode.Attributes["href"] != null)
             {
                 settlementIDRef_ = settlementNode.Attributes["href"].Value;
             }
             else
             {
                 settlement_ = new Payment(settlementNode);
             }
         }
         else
         {
             settlement_ = new Payment(settlementNode);
         }
     }
     
 
     XmlNode priceNode = xmlNode.SelectSingleNode("price");
     
     if (priceNode != null)
     {
         if (priceNode.Attributes["href"] != null || priceNode.Attributes["id"] != null) 
         {
             if (priceNode.Attributes["id"] != null) 
             {
                 priceIDRef_ = priceNode.Attributes["id"].Value;
                 Price ob = new Price(priceNode);
                 IDManager.SetID(priceIDRef_, ob);
             }
             else if (priceNode.Attributes["href"] != null)
             {
                 priceIDRef_ = priceNode.Attributes["href"].Value;
             }
             else
             {
                 price_ = new Price(priceNode);
             }
         }
         else
         {
             price_ = new Price(priceNode);
         }
     }
     
 
 }
 public RelatedParty(XmlNode xmlNode)
 {
     XmlNode partyReferenceNode = xmlNode.SelectSingleNode("partyReference");
     
     if (partyReferenceNode != null)
     {
         if (partyReferenceNode.Attributes["href"] != null || partyReferenceNode.Attributes["id"] != null) 
         {
             if (partyReferenceNode.Attributes["id"] != null) 
             {
                 partyReferenceIDRef_ = partyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(partyReferenceNode);
                 IDManager.SetID(partyReferenceIDRef_, ob);
             }
             else if (partyReferenceNode.Attributes["href"] != null)
             {
                 partyReferenceIDRef_ = partyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 partyReference_ = new PartyReference(partyReferenceNode);
             }
         }
         else
         {
             partyReference_ = new PartyReference(partyReferenceNode);
         }
     }
     
 
     XmlNode accountReferenceNode = xmlNode.SelectSingleNode("accountReference");
     
     if (accountReferenceNode != null)
     {
         if (accountReferenceNode.Attributes["href"] != null || accountReferenceNode.Attributes["id"] != null) 
         {
             if (accountReferenceNode.Attributes["id"] != null) 
             {
                 accountReferenceIDRef_ = accountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(accountReferenceNode);
                 IDManager.SetID(accountReferenceIDRef_, ob);
             }
             else if (accountReferenceNode.Attributes["href"] != null)
             {
                 accountReferenceIDRef_ = accountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 accountReference_ = new AccountReference(accountReferenceNode);
             }
         }
         else
         {
             accountReference_ = new AccountReference(accountReferenceNode);
         }
     }
     
 
     XmlNode roleNode = xmlNode.SelectSingleNode("role");
     
     if (roleNode != null)
     {
         if (roleNode.Attributes["href"] != null || roleNode.Attributes["id"] != null) 
         {
             if (roleNode.Attributes["id"] != null) 
             {
                 roleIDRef_ = roleNode.Attributes["id"].Value;
                 PartyRole ob = new PartyRole(roleNode);
                 IDManager.SetID(roleIDRef_, ob);
             }
             else if (roleNode.Attributes["href"] != null)
             {
                 roleIDRef_ = roleNode.Attributes["href"].Value;
             }
             else
             {
                 role_ = new PartyRole(roleNode);
             }
         }
         else
         {
             role_ = new PartyRole(roleNode);
         }
     }
     
 
     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;
                 PartyRoleType ob = new PartyRoleType(typeNode);
                 IDManager.SetID(typeIDRef_, ob);
             }
             else if (typeNode.Attributes["href"] != null)
             {
                 typeIDRef_ = typeNode.Attributes["href"].Value;
             }
             else
             {
                 type_ = new PartyRoleType(typeNode);
             }
         }
         else
         {
             type_ = new PartyRoleType(typeNode);
         }
     }
     
 
 }
 public CommodityHub(XmlNode xmlNode)
 {
     XmlNodeList partyReferenceNodeList = xmlNode.SelectNodes("partyReference");
     if (partyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in partyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(partyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 partyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList accountReferenceNodeList = xmlNode.SelectNodes("accountReference");
     if (accountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in accountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 accountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(accountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 accountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 accountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList hubCodeNodeList = xmlNode.SelectNodes("hubCode");
     if (hubCodeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in hubCodeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 hubCodeIDRef = item.Attributes["id"].Name;
                 CommodityHubCode ob = CommodityHubCode();
                 IDManager.SetID(hubCodeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 hubCodeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 hubCode = new CommodityHubCode(item);
             }
         }
     }
     
 
 }
        public GeneralTerms(XmlNode xmlNode)
        {
            XmlNodeList effectiveDateNodeList = xmlNode.SelectNodes("effectiveDate");

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

            foreach (XmlNode item in effectiveDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        effectiveDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate2 ob = AdjustableDate2();
                        IDManager.SetID(effectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        effectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        effectiveDate = new AdjustableDate2(item);
                    }
                }
            }


            XmlNodeList scheduledTerminationDateNodeList = xmlNode.SelectNodes("scheduledTerminationDate");

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

            foreach (XmlNode item in scheduledTerminationDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        scheduledTerminationDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate2 ob = AdjustableDate2();
                        IDManager.SetID(scheduledTerminationDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        scheduledTerminationDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        scheduledTerminationDate = new AdjustableDate2(item);
                    }
                }
            }


            XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");

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

            foreach (XmlNode item in buyerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(buyerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");

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

            foreach (XmlNode item in buyerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(buyerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        buyerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        buyerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");

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

            foreach (XmlNode item in sellerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(sellerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");

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

            foreach (XmlNode item in sellerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(sellerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        sellerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        sellerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList dateAdjustmentsNodeList = xmlNode.SelectNodes("dateAdjustments");

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

            foreach (XmlNode item in dateAdjustmentsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dateAdjustmentsIDRef = item.Attributes["id"].Name;
                        BusinessDayAdjustments ob = BusinessDayAdjustments();
                        IDManager.SetID(dateAdjustmentsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dateAdjustmentsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        dateAdjustments = new BusinessDayAdjustments(item);
                    }
                }
            }


            XmlNodeList referenceInformationNodeList = xmlNode.SelectNodes("referenceInformation");

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

            foreach (XmlNode item in referenceInformationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        referenceInformationIDRef = item.Attributes["id"].Name;
                        ReferenceInformation ob = ReferenceInformation();
                        IDManager.SetID(referenceInformationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        referenceInformationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        referenceInformation = new ReferenceInformation(item);
                    }
                }
            }


            XmlNodeList indexReferenceInformationNodeList = xmlNode.SelectNodes("indexReferenceInformation");

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

            foreach (XmlNode item in indexReferenceInformationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        indexReferenceInformationIDRef = item.Attributes["id"].Name;
                        IndexReferenceInformation ob = IndexReferenceInformation();
                        IDManager.SetID(indexReferenceInformationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        indexReferenceInformationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        indexReferenceInformation = new IndexReferenceInformation(item);
                    }
                }
            }


            XmlNodeList basketReferenceInformationNodeList = xmlNode.SelectNodes("basketReferenceInformation");

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

            foreach (XmlNode item in basketReferenceInformationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        basketReferenceInformationIDRef = item.Attributes["id"].Name;
                        BasketReferenceInformation ob = BasketReferenceInformation();
                        IDManager.SetID(basketReferenceInformationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        basketReferenceInformationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        basketReferenceInformation = new BasketReferenceInformation(item);
                    }
                }
            }


            XmlNodeList additionalTermNodeList = xmlNode.SelectNodes("additionalTerm");

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


            XmlNodeList substitutionNodeList = xmlNode.SelectNodes("substitution");

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

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


            XmlNodeList modifiedEquityDeliveryNodeList = xmlNode.SelectNodes("modifiedEquityDelivery");

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

            foreach (XmlNode item in modifiedEquityDeliveryNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        modifiedEquityDeliveryIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(modifiedEquityDeliveryIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        modifiedEquityDeliveryIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        modifiedEquityDelivery = new XsdTypeBoolean(item);
                    }
                }
            }
        }
 public EquityDerivativeBase(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList buyerPartyReferenceNodeList = xmlNode.SelectNodes("buyerPartyReference");
     if (buyerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(buyerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList buyerAccountReferenceNodeList = xmlNode.SelectNodes("buyerAccountReference");
     if (buyerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in buyerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(buyerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 buyerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 buyerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerPartyReferenceNodeList = xmlNode.SelectNodes("sellerPartyReference");
     if (sellerPartyReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerPartyReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef = item.Attributes["id"].Name;
                 PartyReference ob = PartyReference();
                 IDManager.SetID(sellerPartyReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerPartyReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerPartyReference = new PartyReference(item);
             }
         }
     }
     
 
     XmlNodeList sellerAccountReferenceNodeList = xmlNode.SelectNodes("sellerAccountReference");
     if (sellerAccountReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in sellerAccountReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef = item.Attributes["id"].Name;
                 AccountReference ob = AccountReference();
                 IDManager.SetID(sellerAccountReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 sellerAccountReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 sellerAccountReference = new AccountReference(item);
             }
         }
     }
     
 
     XmlNodeList optionTypeNodeList = xmlNode.SelectNodes("optionType");
     if (optionTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionTypeIDRef = item.Attributes["id"].Name;
                 EquityOptionTypeEnum ob = EquityOptionTypeEnum();
                 IDManager.SetID(optionTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionType = new EquityOptionTypeEnum(item);
             }
         }
     }
     
 
     XmlNodeList equityEffectiveDateNodeList = xmlNode.SelectNodes("equityEffectiveDate");
     if (equityEffectiveDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityEffectiveDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityEffectiveDateIDRef = item.Attributes["id"].Name;
                 XsdTypeDate ob = XsdTypeDate();
                 IDManager.SetID(equityEffectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityEffectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equityEffectiveDate = new XsdTypeDate(item);
             }
         }
     }
     
 
     XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");
     if (underlyerNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in underlyerNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 underlyerIDRef = item.Attributes["id"].Name;
                 Underlyer ob = Underlyer();
                 IDManager.SetID(underlyerIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 underlyerIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 underlyer = new Underlyer(item);
             }
         }
     }
     
 
     XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");
     if (notionalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(notionalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notional = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList equityExerciseNodeList = xmlNode.SelectNodes("equityExercise");
     if (equityExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityExerciseIDRef = item.Attributes["id"].Name;
                 EquityExerciseValuationSettlement ob = EquityExerciseValuationSettlement();
                 IDManager.SetID(equityExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equityExercise = new EquityExerciseValuationSettlement(item);
             }
         }
     }
     
 
     XmlNodeList featureNodeList = xmlNode.SelectNodes("feature");
     if (featureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in featureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 featureIDRef = item.Attributes["id"].Name;
                 OptionFeatures ob = OptionFeatures();
                 IDManager.SetID(featureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 featureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 feature = new OptionFeatures(item);
             }
         }
     }
     
 
     XmlNodeList fxFeatureNodeList = xmlNode.SelectNodes("fxFeature");
     if (fxFeatureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxFeatureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxFeatureIDRef = item.Attributes["id"].Name;
                 FxFeature ob = FxFeature();
                 IDManager.SetID(fxFeatureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxFeatureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fxFeature = new FxFeature(item);
             }
         }
     }
     
 
     XmlNodeList strategyFeatureNodeList = xmlNode.SelectNodes("strategyFeature");
     if (strategyFeatureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strategyFeatureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strategyFeatureIDRef = item.Attributes["id"].Name;
                 StrategyFeature ob = StrategyFeature();
                 IDManager.SetID(strategyFeatureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strategyFeatureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strategyFeature = new StrategyFeature(item);
             }
         }
     }
     
 
 }
Example #54
0
        public GenericProduct(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode multiLegNode = xmlNode.SelectSingleNode("multiLeg");

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


            XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");

            if (buyerPartyReferenceNode != null)
            {
                if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (buyerPartyReferenceNode.Attributes["id"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                        IDManager.SetID(buyerPartyReferenceIDRef_, ob);
                    }
                    else if (buyerPartyReferenceNode.Attributes["href"] != null)
                    {
                        buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                    }
                }
                else
                {
                    buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
                }
            }


            XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");

            if (buyerAccountReferenceNode != null)
            {
                if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (buyerAccountReferenceNode.Attributes["id"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                        IDManager.SetID(buyerAccountReferenceIDRef_, ob);
                    }
                    else if (buyerAccountReferenceNode.Attributes["href"] != null)
                    {
                        buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                    }
                }
                else
                {
                    buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
                }
            }


            XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");

            if (sellerPartyReferenceNode != null)
            {
                if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null)
                {
                    if (sellerPartyReferenceNode.Attributes["id"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                        PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                        IDManager.SetID(sellerPartyReferenceIDRef_, ob);
                    }
                    else if (sellerPartyReferenceNode.Attributes["href"] != null)
                    {
                        sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                    }
                }
                else
                {
                    sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
                }
            }


            XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");

            if (sellerAccountReferenceNode != null)
            {
                if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null)
                {
                    if (sellerAccountReferenceNode.Attributes["id"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                        AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                        IDManager.SetID(sellerAccountReferenceIDRef_, ob);
                    }
                    else if (sellerAccountReferenceNode.Attributes["href"] != null)
                    {
                        sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                    }
                }
                else
                {
                    sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
                }
            }


            XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference");

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


            XmlNode premiumNode = xmlNode.SelectSingleNode("premium");

            if (premiumNode != null)
            {
                if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null)
                {
                    if (premiumNode.Attributes["id"] != null)
                    {
                        premiumIDRef_ = premiumNode.Attributes["id"].Value;
                        SimplePayment ob = new SimplePayment(premiumNode);
                        IDManager.SetID(premiumIDRef_, ob);
                    }
                    else if (premiumNode.Attributes["href"] != null)
                    {
                        premiumIDRef_ = premiumNode.Attributes["href"].Value;
                    }
                    else
                    {
                        premium_ = new SimplePayment(premiumNode);
                    }
                }
                else
                {
                    premium_ = new SimplePayment(premiumNode);
                }
            }


            XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");

            if (effectiveDateNode != null)
            {
                if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null)
                {
                    if (effectiveDateNode.Attributes["id"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                        AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode);
                        IDManager.SetID(effectiveDateIDRef_, ob);
                    }
                    else if (effectiveDateNode.Attributes["href"] != null)
                    {
                        effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        effectiveDate_ = new AdjustableDate2(effectiveDateNode);
                    }
                }
                else
                {
                    effectiveDate_ = new AdjustableDate2(effectiveDateNode);
                }
            }


            XmlNode expirationDateNode = xmlNode.SelectSingleNode("expirationDate");

            if (expirationDateNode != null)
            {
                if (expirationDateNode.Attributes["href"] != null || expirationDateNode.Attributes["id"] != null)
                {
                    if (expirationDateNode.Attributes["id"] != null)
                    {
                        expirationDateIDRef_ = expirationDateNode.Attributes["id"].Value;
                        AdjustableDate2 ob = new AdjustableDate2(expirationDateNode);
                        IDManager.SetID(expirationDateIDRef_, ob);
                    }
                    else if (expirationDateNode.Attributes["href"] != null)
                    {
                        expirationDateIDRef_ = expirationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        expirationDate_ = new AdjustableDate2(expirationDateNode);
                    }
                }
                else
                {
                    expirationDate_ = new AdjustableDate2(expirationDateNode);
                }
            }


            XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate");

            if (terminationDateNode != null)
            {
                if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null)
                {
                    if (terminationDateNode.Attributes["id"] != null)
                    {
                        terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value;
                        AdjustableDate2 ob = new AdjustableDate2(terminationDateNode);
                        IDManager.SetID(terminationDateIDRef_, ob);
                    }
                    else if (terminationDateNode.Attributes["href"] != null)
                    {
                        terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        terminationDate_ = new AdjustableDate2(terminationDateNode);
                    }
                }
                else
                {
                    terminationDate_ = new AdjustableDate2(terminationDateNode);
                }
            }


            XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");

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


            XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");

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


            XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType");

            if (optionTypeNode != null)
            {
                if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null)
                {
                    if (optionTypeNode.Attributes["id"] != null)
                    {
                        optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value;
                        OptionType ob = new OptionType(optionTypeNode);
                        IDManager.SetID(optionTypeIDRef_, ob);
                    }
                    else if (optionTypeNode.Attributes["href"] != null)
                    {
                        optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionType_ = new OptionType(optionTypeNode);
                    }
                }
                else
                {
                    optionType_ = new OptionType(optionTypeNode);
                }
            }


            XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");

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


            XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");

            if (dayCountFractionNodeList != null)
            {
                this.dayCountFraction_ = new List <DayCountFraction>();
                foreach (XmlNode item in dayCountFractionNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            dayCountFractionIDRef_ = item.Attributes["id"].Value;
                            dayCountFraction_.Add(new DayCountFraction(item));
                            IDManager.SetID(dayCountFractionIDRef_, dayCountFraction_[dayCountFraction_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            dayCountFractionIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            dayCountFraction_.Add(new DayCountFraction(item));
                        }
                    }
                    else
                    {
                        dayCountFraction_.Add(new DayCountFraction(item));
                    }
                }
            }
        }
 public Option(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
 }
 public InterestRateStream(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode calculationPeriodDatesNode = xmlNode.SelectSingleNode("calculationPeriodDates");
     
     if (calculationPeriodDatesNode != null)
     {
         if (calculationPeriodDatesNode.Attributes["href"] != null || calculationPeriodDatesNode.Attributes["id"] != null) 
         {
             if (calculationPeriodDatesNode.Attributes["id"] != null) 
             {
                 calculationPeriodDatesIDRef_ = calculationPeriodDatesNode.Attributes["id"].Value;
                 CalculationPeriodDates ob = new CalculationPeriodDates(calculationPeriodDatesNode);
                 IDManager.SetID(calculationPeriodDatesIDRef_, ob);
             }
             else if (calculationPeriodDatesNode.Attributes["href"] != null)
             {
                 calculationPeriodDatesIDRef_ = calculationPeriodDatesNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodDates_ = new CalculationPeriodDates(calculationPeriodDatesNode);
             }
         }
         else
         {
             calculationPeriodDates_ = new CalculationPeriodDates(calculationPeriodDatesNode);
         }
     }
     
 
     XmlNode paymentDatesNode = xmlNode.SelectSingleNode("paymentDates");
     
     if (paymentDatesNode != null)
     {
         if (paymentDatesNode.Attributes["href"] != null || paymentDatesNode.Attributes["id"] != null) 
         {
             if (paymentDatesNode.Attributes["id"] != null) 
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["id"].Value;
                 PaymentDates ob = new PaymentDates(paymentDatesNode);
                 IDManager.SetID(paymentDatesIDRef_, ob);
             }
             else if (paymentDatesNode.Attributes["href"] != null)
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDates_ = new PaymentDates(paymentDatesNode);
             }
         }
         else
         {
             paymentDates_ = new PaymentDates(paymentDatesNode);
         }
     }
     
 
     XmlNode resetDatesNode = xmlNode.SelectSingleNode("resetDates");
     
     if (resetDatesNode != null)
     {
         if (resetDatesNode.Attributes["href"] != null || resetDatesNode.Attributes["id"] != null) 
         {
             if (resetDatesNode.Attributes["id"] != null) 
             {
                 resetDatesIDRef_ = resetDatesNode.Attributes["id"].Value;
                 ResetDates ob = new ResetDates(resetDatesNode);
                 IDManager.SetID(resetDatesIDRef_, ob);
             }
             else if (resetDatesNode.Attributes["href"] != null)
             {
                 resetDatesIDRef_ = resetDatesNode.Attributes["href"].Value;
             }
             else
             {
                 resetDates_ = new ResetDates(resetDatesNode);
             }
         }
         else
         {
             resetDates_ = new ResetDates(resetDatesNode);
         }
     }
     
 
     XmlNode calculationPeriodAmountNode = xmlNode.SelectSingleNode("calculationPeriodAmount");
     
     if (calculationPeriodAmountNode != null)
     {
         if (calculationPeriodAmountNode.Attributes["href"] != null || calculationPeriodAmountNode.Attributes["id"] != null) 
         {
             if (calculationPeriodAmountNode.Attributes["id"] != null) 
             {
                 calculationPeriodAmountIDRef_ = calculationPeriodAmountNode.Attributes["id"].Value;
                 CalculationPeriodAmount ob = new CalculationPeriodAmount(calculationPeriodAmountNode);
                 IDManager.SetID(calculationPeriodAmountIDRef_, ob);
             }
             else if (calculationPeriodAmountNode.Attributes["href"] != null)
             {
                 calculationPeriodAmountIDRef_ = calculationPeriodAmountNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodAmount_ = new CalculationPeriodAmount(calculationPeriodAmountNode);
             }
         }
         else
         {
             calculationPeriodAmount_ = new CalculationPeriodAmount(calculationPeriodAmountNode);
         }
     }
     
 
     XmlNode stubCalculationPeriodAmountNode = xmlNode.SelectSingleNode("stubCalculationPeriodAmount");
     
     if (stubCalculationPeriodAmountNode != null)
     {
         if (stubCalculationPeriodAmountNode.Attributes["href"] != null || stubCalculationPeriodAmountNode.Attributes["id"] != null) 
         {
             if (stubCalculationPeriodAmountNode.Attributes["id"] != null) 
             {
                 stubCalculationPeriodAmountIDRef_ = stubCalculationPeriodAmountNode.Attributes["id"].Value;
                 StubCalculationPeriodAmount ob = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
                 IDManager.SetID(stubCalculationPeriodAmountIDRef_, ob);
             }
             else if (stubCalculationPeriodAmountNode.Attributes["href"] != null)
             {
                 stubCalculationPeriodAmountIDRef_ = stubCalculationPeriodAmountNode.Attributes["href"].Value;
             }
             else
             {
                 stubCalculationPeriodAmount_ = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
             }
         }
         else
         {
             stubCalculationPeriodAmount_ = new StubCalculationPeriodAmount(stubCalculationPeriodAmountNode);
         }
     }
     
 
     XmlNode principalExchangesNode = xmlNode.SelectSingleNode("principalExchanges");
     
     if (principalExchangesNode != null)
     {
         if (principalExchangesNode.Attributes["href"] != null || principalExchangesNode.Attributes["id"] != null) 
         {
             if (principalExchangesNode.Attributes["id"] != null) 
             {
                 principalExchangesIDRef_ = principalExchangesNode.Attributes["id"].Value;
                 PrincipalExchanges ob = new PrincipalExchanges(principalExchangesNode);
                 IDManager.SetID(principalExchangesIDRef_, ob);
             }
             else if (principalExchangesNode.Attributes["href"] != null)
             {
                 principalExchangesIDRef_ = principalExchangesNode.Attributes["href"].Value;
             }
             else
             {
                 principalExchanges_ = new PrincipalExchanges(principalExchangesNode);
             }
         }
         else
         {
             principalExchanges_ = new PrincipalExchanges(principalExchangesNode);
         }
     }
     
 
     XmlNode cashflowsNode = xmlNode.SelectSingleNode("cashflows");
     
     if (cashflowsNode != null)
     {
         if (cashflowsNode.Attributes["href"] != null || cashflowsNode.Attributes["id"] != null) 
         {
             if (cashflowsNode.Attributes["id"] != null) 
             {
                 cashflowsIDRef_ = cashflowsNode.Attributes["id"].Value;
                 Cashflows ob = new Cashflows(cashflowsNode);
                 IDManager.SetID(cashflowsIDRef_, ob);
             }
             else if (cashflowsNode.Attributes["href"] != null)
             {
                 cashflowsIDRef_ = cashflowsNode.Attributes["href"].Value;
             }
             else
             {
                 cashflows_ = new Cashflows(cashflowsNode);
             }
         }
         else
         {
             cashflows_ = new Cashflows(cashflowsNode);
         }
     }
     
 
     XmlNode settlementProvisionNode = xmlNode.SelectSingleNode("settlementProvision");
     
     if (settlementProvisionNode != null)
     {
         if (settlementProvisionNode.Attributes["href"] != null || settlementProvisionNode.Attributes["id"] != null) 
         {
             if (settlementProvisionNode.Attributes["id"] != null) 
             {
                 settlementProvisionIDRef_ = settlementProvisionNode.Attributes["id"].Value;
                 SettlementProvision ob = new SettlementProvision(settlementProvisionNode);
                 IDManager.SetID(settlementProvisionIDRef_, ob);
             }
             else if (settlementProvisionNode.Attributes["href"] != null)
             {
                 settlementProvisionIDRef_ = settlementProvisionNode.Attributes["href"].Value;
             }
             else
             {
                 settlementProvision_ = new SettlementProvision(settlementProvisionNode);
             }
         }
         else
         {
             settlementProvision_ = new SettlementProvision(settlementProvisionNode);
         }
     }
     
 
     XmlNode formulaNode = xmlNode.SelectSingleNode("formula");
     
     if (formulaNode != null)
     {
         if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null) 
         {
             if (formulaNode.Attributes["id"] != null) 
             {
                 formulaIDRef_ = formulaNode.Attributes["id"].Value;
                 Formula ob = new Formula(formulaNode);
                 IDManager.SetID(formulaIDRef_, ob);
             }
             else if (formulaNode.Attributes["href"] != null)
             {
                 formulaIDRef_ = formulaNode.Attributes["href"].Value;
             }
             else
             {
                 formula_ = new Formula(formulaNode);
             }
         }
         else
         {
             formula_ = new Formula(formulaNode);
         }
     }
     
 
 }
 public PrincipalExchangeDescriptions(XmlNode xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode principalExchangeAmountNode = xmlNode.SelectSingleNode("principalExchangeAmount");
     
     if (principalExchangeAmountNode != null)
     {
         if (principalExchangeAmountNode.Attributes["href"] != null || principalExchangeAmountNode.Attributes["id"] != null) 
         {
             if (principalExchangeAmountNode.Attributes["id"] != null) 
             {
                 principalExchangeAmountIDRef_ = principalExchangeAmountNode.Attributes["id"].Value;
                 PrincipalExchangeAmount ob = new PrincipalExchangeAmount(principalExchangeAmountNode);
                 IDManager.SetID(principalExchangeAmountIDRef_, ob);
             }
             else if (principalExchangeAmountNode.Attributes["href"] != null)
             {
                 principalExchangeAmountIDRef_ = principalExchangeAmountNode.Attributes["href"].Value;
             }
             else
             {
                 principalExchangeAmount_ = new PrincipalExchangeAmount(principalExchangeAmountNode);
             }
         }
         else
         {
             principalExchangeAmount_ = new PrincipalExchangeAmount(principalExchangeAmountNode);
         }
     }
     
 
     XmlNode principalExchangeDateNode = xmlNode.SelectSingleNode("principalExchangeDate");
     
     if (principalExchangeDateNode != null)
     {
         if (principalExchangeDateNode.Attributes["href"] != null || principalExchangeDateNode.Attributes["id"] != null) 
         {
             if (principalExchangeDateNode.Attributes["id"] != null) 
             {
                 principalExchangeDateIDRef_ = principalExchangeDateNode.Attributes["id"].Value;
                 AdjustableOrRelativeDate ob = new AdjustableOrRelativeDate(principalExchangeDateNode);
                 IDManager.SetID(principalExchangeDateIDRef_, ob);
             }
             else if (principalExchangeDateNode.Attributes["href"] != null)
             {
                 principalExchangeDateIDRef_ = principalExchangeDateNode.Attributes["href"].Value;
             }
             else
             {
                 principalExchangeDate_ = new AdjustableOrRelativeDate(principalExchangeDateNode);
             }
         }
         else
         {
             principalExchangeDate_ = new AdjustableOrRelativeDate(principalExchangeDateNode);
         }
     }
     
 
 }
Example #58
0
        public AveragePriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

            foreach (XmlNode item in payerPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(payerPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList payerAccountReferenceNodeList = xmlNode.SelectNodes("payerAccountReference");

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

            foreach (XmlNode item in payerAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payerAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(payerAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payerAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payerAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList receiverPartyReferenceNodeList = xmlNode.SelectNodes("receiverPartyReference");

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

            foreach (XmlNode item in receiverPartyReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverPartyReferenceIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(receiverPartyReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverPartyReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverPartyReference = new PartyReference(item);
                    }
                }
            }


            XmlNodeList receiverAccountReferenceNodeList = xmlNode.SelectNodes("receiverAccountReference");

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

            foreach (XmlNode item in receiverAccountReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        receiverAccountReferenceIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(receiverAccountReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        receiverAccountReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        receiverAccountReference = new AccountReference(item);
                    }
                }
            }


            XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates");

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

            foreach (XmlNode item in calculationDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationDatesIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationDates = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsNodeList = xmlNode.SelectNodes("calculationPeriods");

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

            foreach (XmlNode item in calculationPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsIDRef = item.Attributes["id"].Name;
                        AdjustableDates ob = AdjustableDates();
                        IDManager.SetID(calculationPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriods = new AdjustableDates(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsScheduleNodeList = xmlNode.SelectNodes("calculationPeriodsSchedule");

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

            foreach (XmlNode item in calculationPeriodsScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsScheduleIDRef = item.Attributes["id"].Name;
                        CommodityCalculationPeriodsSchedule ob = CommodityCalculationPeriodsSchedule();
                        IDManager.SetID(calculationPeriodsScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsSchedule = new CommodityCalculationPeriodsSchedule(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference");

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

            foreach (XmlNode item in calculationPeriodsReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsReference ob = CalculationPeriodsReference();
                        IDManager.SetID(calculationPeriodsReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsReference = new CalculationPeriodsReference(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference");

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

            foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference();
                        IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item);
                    }
                }
            }


            XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference");

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

            foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference();
                        IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(item);
                    }
                }
            }


            XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");

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

            foreach (XmlNode item in commodityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        commodityIDRef = item.Attributes["id"].Name;
                        Commodity ob = Commodity();
                        IDManager.SetID(commodityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        commodityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        commodity = new Commodity(item);
                    }
                }
            }


            XmlNodeList quantityReferenceNodeList = xmlNode.SelectNodes("quantityReference");

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

            foreach (XmlNode item in quantityReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quantityReferenceIDRef = item.Attributes["id"].Name;
                        QuantityReference ob = QuantityReference();
                        IDManager.SetID(quantityReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quantityReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quantityReference = new QuantityReference(item);
                    }
                }
            }


            XmlNodeList pricingStartDateNodeList = xmlNode.SelectNodes("pricingStartDate");

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

            foreach (XmlNode item in pricingStartDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pricingStartDateIDRef = item.Attributes["id"].Name;
                        AdjustableDate ob = AdjustableDate();
                        IDManager.SetID(pricingStartDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pricingStartDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pricingStartDate = new AdjustableDate(item);
                    }
                }
            }


            XmlNodeList calculationNodeList = xmlNode.SelectNodes("calculation");

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

            foreach (XmlNode item in calculationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationIDRef = item.Attributes["id"].Name;
                        FloatingLegCalculation ob = FloatingLegCalculation();
                        IDManager.SetID(calculationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculation = new FloatingLegCalculation(item);
                    }
                }
            }


            XmlNodeList relativePaymentDatesNodeList = xmlNode.SelectNodes("relativePaymentDates");

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

            foreach (XmlNode item in relativePaymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        relativePaymentDatesIDRef = item.Attributes["id"].Name;
                        CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                        IDManager.SetID(relativePaymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        relativePaymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        relativePaymentDates = new CommodityRelativePaymentDates(item);
                    }
                }
            }


            XmlNodeList paymentDatesNodeList = xmlNode.SelectNodes("paymentDates");

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

            foreach (XmlNode item in paymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDatesIDRef = item.Attributes["id"].Name;
                        AdjustableDatesOrRelativeDateOffset ob = AdjustableDatesOrRelativeDateOffset();
                        IDManager.SetID(paymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDates = new AdjustableDatesOrRelativeDateOffset(item);
                    }
                }
            }


            XmlNodeList masterAgreementPaymentDatesNodeList = xmlNode.SelectNodes("masterAgreementPaymentDates");

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

            foreach (XmlNode item in masterAgreementPaymentDatesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(masterAgreementPaymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        masterAgreementPaymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        masterAgreementPaymentDates = new XsdTypeBoolean(item);
                    }
                }
            }
        }
 public GenericProduct(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode multiLegNode = xmlNode.SelectSingleNode("multiLeg");
     
     if (multiLegNode != null)
     {
         if (multiLegNode.Attributes["href"] != null || multiLegNode.Attributes["id"] != null) 
         {
             if (multiLegNode.Attributes["id"] != null) 
             {
                 multiLegIDRef_ = multiLegNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(multiLegNode);
                 IDManager.SetID(multiLegIDRef_, ob);
             }
             else if (multiLegNode.Attributes["href"] != null)
             {
                 multiLegIDRef_ = multiLegNode.Attributes["href"].Value;
             }
             else
             {
                 multiLeg_ = new XsdTypeBoolean(multiLegNode);
             }
         }
         else
         {
             multiLeg_ = new XsdTypeBoolean(multiLegNode);
         }
     }
     
 
     XmlNode buyerPartyReferenceNode = xmlNode.SelectSingleNode("buyerPartyReference");
     
     if (buyerPartyReferenceNode != null)
     {
         if (buyerPartyReferenceNode.Attributes["href"] != null || buyerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (buyerPartyReferenceNode.Attributes["id"] != null) 
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(buyerPartyReferenceNode);
                 IDManager.SetID(buyerPartyReferenceIDRef_, ob);
             }
             else if (buyerPartyReferenceNode.Attributes["href"] != null)
             {
                 buyerPartyReferenceIDRef_ = buyerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
             }
         }
         else
         {
             buyerPartyReference_ = new PartyReference(buyerPartyReferenceNode);
         }
     }
     
 
     XmlNode buyerAccountReferenceNode = xmlNode.SelectSingleNode("buyerAccountReference");
     
     if (buyerAccountReferenceNode != null)
     {
         if (buyerAccountReferenceNode.Attributes["href"] != null || buyerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (buyerAccountReferenceNode.Attributes["id"] != null) 
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(buyerAccountReferenceNode);
                 IDManager.SetID(buyerAccountReferenceIDRef_, ob);
             }
             else if (buyerAccountReferenceNode.Attributes["href"] != null)
             {
                 buyerAccountReferenceIDRef_ = buyerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
             }
         }
         else
         {
             buyerAccountReference_ = new AccountReference(buyerAccountReferenceNode);
         }
     }
     
 
     XmlNode sellerPartyReferenceNode = xmlNode.SelectSingleNode("sellerPartyReference");
     
     if (sellerPartyReferenceNode != null)
     {
         if (sellerPartyReferenceNode.Attributes["href"] != null || sellerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (sellerPartyReferenceNode.Attributes["id"] != null) 
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(sellerPartyReferenceNode);
                 IDManager.SetID(sellerPartyReferenceIDRef_, ob);
             }
             else if (sellerPartyReferenceNode.Attributes["href"] != null)
             {
                 sellerPartyReferenceIDRef_ = sellerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
             }
         }
         else
         {
             sellerPartyReference_ = new PartyReference(sellerPartyReferenceNode);
         }
     }
     
 
     XmlNode sellerAccountReferenceNode = xmlNode.SelectSingleNode("sellerAccountReference");
     
     if (sellerAccountReferenceNode != null)
     {
         if (sellerAccountReferenceNode.Attributes["href"] != null || sellerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (sellerAccountReferenceNode.Attributes["id"] != null) 
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(sellerAccountReferenceNode);
                 IDManager.SetID(sellerAccountReferenceIDRef_, ob);
             }
             else if (sellerAccountReferenceNode.Attributes["href"] != null)
             {
                 sellerAccountReferenceIDRef_ = sellerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
             }
         }
         else
         {
             sellerAccountReference_ = new AccountReference(sellerAccountReferenceNode);
         }
     }
     
 
     XmlNodeList counterpartyReferenceNodeList = xmlNode.SelectNodes("counterpartyReference");
     
     if (counterpartyReferenceNodeList != null)
     {
         this.counterpartyReference_ = new List<PartyReference>();
         foreach (XmlNode item in counterpartyReferenceNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     counterpartyReferenceIDRef_ = item.Attributes["id"].Value;
                     counterpartyReference_.Add(new PartyReference(item));
                     IDManager.SetID(counterpartyReferenceIDRef_, counterpartyReference_[counterpartyReference_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     counterpartyReferenceIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 counterpartyReference_.Add(new PartyReference(item));
                 }
             }
             else
             {
                 counterpartyReference_.Add(new PartyReference(item));
             }
         }
     }
     
 
     XmlNode premiumNode = xmlNode.SelectSingleNode("premium");
     
     if (premiumNode != null)
     {
         if (premiumNode.Attributes["href"] != null || premiumNode.Attributes["id"] != null) 
         {
             if (premiumNode.Attributes["id"] != null) 
             {
                 premiumIDRef_ = premiumNode.Attributes["id"].Value;
                 SimplePayment ob = new SimplePayment(premiumNode);
                 IDManager.SetID(premiumIDRef_, ob);
             }
             else if (premiumNode.Attributes["href"] != null)
             {
                 premiumIDRef_ = premiumNode.Attributes["href"].Value;
             }
             else
             {
                 premium_ = new SimplePayment(premiumNode);
             }
         }
         else
         {
             premium_ = new SimplePayment(premiumNode);
         }
     }
     
 
     XmlNode effectiveDateNode = xmlNode.SelectSingleNode("effectiveDate");
     
     if (effectiveDateNode != null)
     {
         if (effectiveDateNode.Attributes["href"] != null || effectiveDateNode.Attributes["id"] != null) 
         {
             if (effectiveDateNode.Attributes["id"] != null) 
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["id"].Value;
                 AdjustableDate2 ob = new AdjustableDate2(effectiveDateNode);
                 IDManager.SetID(effectiveDateIDRef_, ob);
             }
             else if (effectiveDateNode.Attributes["href"] != null)
             {
                 effectiveDateIDRef_ = effectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 effectiveDate_ = new AdjustableDate2(effectiveDateNode);
             }
         }
         else
         {
             effectiveDate_ = new AdjustableDate2(effectiveDateNode);
         }
     }
     
 
     XmlNode expirationDateNode = xmlNode.SelectSingleNode("expirationDate");
     
     if (expirationDateNode != null)
     {
         if (expirationDateNode.Attributes["href"] != null || expirationDateNode.Attributes["id"] != null) 
         {
             if (expirationDateNode.Attributes["id"] != null) 
             {
                 expirationDateIDRef_ = expirationDateNode.Attributes["id"].Value;
                 AdjustableDate2 ob = new AdjustableDate2(expirationDateNode);
                 IDManager.SetID(expirationDateIDRef_, ob);
             }
             else if (expirationDateNode.Attributes["href"] != null)
             {
                 expirationDateIDRef_ = expirationDateNode.Attributes["href"].Value;
             }
             else
             {
                 expirationDate_ = new AdjustableDate2(expirationDateNode);
             }
         }
         else
         {
             expirationDate_ = new AdjustableDate2(expirationDateNode);
         }
     }
     
 
     XmlNode terminationDateNode = xmlNode.SelectSingleNode("terminationDate");
     
     if (terminationDateNode != null)
     {
         if (terminationDateNode.Attributes["href"] != null || terminationDateNode.Attributes["id"] != null) 
         {
             if (terminationDateNode.Attributes["id"] != null) 
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["id"].Value;
                 AdjustableDate2 ob = new AdjustableDate2(terminationDateNode);
                 IDManager.SetID(terminationDateIDRef_, ob);
             }
             else if (terminationDateNode.Attributes["href"] != null)
             {
                 terminationDateIDRef_ = terminationDateNode.Attributes["href"].Value;
             }
             else
             {
                 terminationDate_ = new AdjustableDate2(terminationDateNode);
             }
         }
         else
         {
             terminationDate_ = new AdjustableDate2(terminationDateNode);
         }
     }
     
 
     XmlNodeList underlyerNodeList = xmlNode.SelectNodes("underlyer");
     
     if (underlyerNodeList != null)
     {
         this.underlyer_ = new List<TradeUnderlyer2>();
         foreach (XmlNode item in underlyerNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     underlyerIDRef_ = item.Attributes["id"].Value;
                     underlyer_.Add(new TradeUnderlyer2(item));
                     IDManager.SetID(underlyerIDRef_, underlyer_[underlyer_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     underlyerIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 underlyer_.Add(new TradeUnderlyer2(item));
                 }
             }
             else
             {
                 underlyer_.Add(new TradeUnderlyer2(item));
             }
         }
     }
     
 
     XmlNodeList notionalNodeList = xmlNode.SelectNodes("notional");
     
     if (notionalNodeList != null)
     {
         this.notional_ = new List<CashflowNotional>();
         foreach (XmlNode item in notionalNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     notionalIDRef_ = item.Attributes["id"].Value;
                     notional_.Add(new CashflowNotional(item));
                     IDManager.SetID(notionalIDRef_, notional_[notional_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     notionalIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 notional_.Add(new CashflowNotional(item));
                 }
             }
             else
             {
                 notional_.Add(new CashflowNotional(item));
             }
         }
     }
     
 
     XmlNode optionTypeNode = xmlNode.SelectSingleNode("optionType");
     
     if (optionTypeNode != null)
     {
         if (optionTypeNode.Attributes["href"] != null || optionTypeNode.Attributes["id"] != null) 
         {
             if (optionTypeNode.Attributes["id"] != null) 
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["id"].Value;
                 OptionType ob = new OptionType(optionTypeNode);
                 IDManager.SetID(optionTypeIDRef_, ob);
             }
             else if (optionTypeNode.Attributes["href"] != null)
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 optionType_ = new OptionType(optionTypeNode);
             }
         }
         else
         {
             optionType_ = new OptionType(optionTypeNode);
         }
     }
     
 
     XmlNodeList settlementCurrencyNodeList = xmlNode.SelectNodes("settlementCurrency");
     
     if (settlementCurrencyNodeList != null)
     {
         this.settlementCurrency_ = new List<IdentifiedCurrency>();
         foreach (XmlNode item in settlementCurrencyNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     settlementCurrencyIDRef_ = item.Attributes["id"].Value;
                     settlementCurrency_.Add(new IdentifiedCurrency(item));
                     IDManager.SetID(settlementCurrencyIDRef_, settlementCurrency_[settlementCurrency_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     settlementCurrencyIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 settlementCurrency_.Add(new IdentifiedCurrency(item));
                 }
             }
             else
             {
                 settlementCurrency_.Add(new IdentifiedCurrency(item));
             }
         }
     }
     
 
     XmlNodeList dayCountFractionNodeList = xmlNode.SelectNodes("dayCountFraction");
     
     if (dayCountFractionNodeList != null)
     {
         this.dayCountFraction_ = new List<DayCountFraction>();
         foreach (XmlNode item in dayCountFractionNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     dayCountFractionIDRef_ = item.Attributes["id"].Value;
                     dayCountFraction_.Add(new DayCountFraction(item));
                     IDManager.SetID(dayCountFractionIDRef_, dayCountFraction_[dayCountFraction_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     dayCountFractionIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 dayCountFraction_.Add(new DayCountFraction(item));
                 }
             }
             else
             {
                 dayCountFraction_.Add(new DayCountFraction(item));
             }
         }
     }
     
 
 }
Example #60
0
        public ReportingRoles(XmlNode xmlNode)
        {
            XmlNodeList basePartyNodeList = xmlNode.SelectNodes("baseParty");

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

            foreach (XmlNode item in basePartyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        basePartyIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(basePartyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        basePartyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        baseParty = new PartyReference(item);
                    }
                }
            }


            XmlNodeList baseAccountNodeList = xmlNode.SelectNodes("baseAccount");

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

            foreach (XmlNode item in baseAccountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        baseAccountIDRef = item.Attributes["id"].Name;
                        AccountReference ob = AccountReference();
                        IDManager.SetID(baseAccountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        baseAccountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        baseAccount = new AccountReference(item);
                    }
                }
            }


            XmlNodeList activityProviderNodeList = xmlNode.SelectNodes("activityProvider");

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

            foreach (XmlNode item in activityProviderNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        activityProviderIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(activityProviderIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        activityProviderIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        activityProvider = new PartyReference(item);
                    }
                }
            }


            XmlNodeList positionProviderNodeList = xmlNode.SelectNodes("positionProvider");

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

            foreach (XmlNode item in positionProviderNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        positionProviderIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(positionProviderIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        positionProviderIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        positionProvider = new PartyReference(item);
                    }
                }
            }


            XmlNodeList valuationProviderNodeList = xmlNode.SelectNodes("valuationProvider");

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

            foreach (XmlNode item in valuationProviderNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationProviderIDRef = item.Attributes["id"].Name;
                        PartyReference ob = PartyReference();
                        IDManager.SetID(valuationProviderIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationProviderIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationProvider = new PartyReference(item);
                    }
                }
            }
        }