public EquityForward(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList forwardPriceNodeList = xmlNode.SelectNodes("forwardPrice");

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

            foreach (XmlNode item in forwardPriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        forwardPriceIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(forwardPriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        forwardPriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        forwardPrice = new NonNegativeMoney(item);
                    }
                }
            }
        }
        public CommodityPremium(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode premiumPerUnitNode = xmlNode.SelectSingleNode("premiumPerUnit");

            if (premiumPerUnitNode != null)
            {
                if (premiumPerUnitNode.Attributes["href"] != null || premiumPerUnitNode.Attributes["id"] != null)
                {
                    if (premiumPerUnitNode.Attributes["id"] != null)
                    {
                        premiumPerUnitIDRef_ = premiumPerUnitNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(premiumPerUnitNode);
                        IDManager.SetID(premiumPerUnitIDRef_, ob);
                    }
                    else if (premiumPerUnitNode.Attributes["href"] != null)
                    {
                        premiumPerUnitIDRef_ = premiumPerUnitNode.Attributes["href"].Value;
                    }
                    else
                    {
                        premiumPerUnit_ = new NonNegativeMoney(premiumPerUnitNode);
                    }
                }
                else
                {
                    premiumPerUnit_ = new NonNegativeMoney(premiumPerUnitNode);
                }
            }
        }
Example #3
0
        public FixedPaymentAmount(XmlNode xmlNode)
            : base(xmlNode)
        {
            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;
                        RelativeDateOffset ob = RelativeDateOffset();
                        IDManager.SetID(paymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDate = new RelativeDateOffset(item);
                    }
                }
            }
        }
 public NonNegativePayment(XmlNode xmlNode)
 : base(xmlNode)
 {
     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);
             }
         }
     }
     
 
 }
 public CommodityPremium(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList premiumPerUnitNodeList = xmlNode.SelectNodes("premiumPerUnit");
     if (premiumPerUnitNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in premiumPerUnitNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 premiumPerUnitIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(premiumPerUnitIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumPerUnitIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 premiumPerUnit = new NonNegativeMoney(item);
             }
         }
     }
     
 
 }
 public EquityForward(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode forwardPriceNode = xmlNode.SelectSingleNode("forwardPrice");
     
     if (forwardPriceNode != null)
     {
         if (forwardPriceNode.Attributes["href"] != null || forwardPriceNode.Attributes["id"] != null) 
         {
             if (forwardPriceNode.Attributes["id"] != null) 
             {
                 forwardPriceIDRef_ = forwardPriceNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(forwardPriceNode);
                 IDManager.SetID(forwardPriceIDRef_, ob);
             }
             else if (forwardPriceNode.Attributes["href"] != null)
             {
                 forwardPriceIDRef_ = forwardPriceNode.Attributes["href"].Value;
             }
             else
             {
                 forwardPrice_ = new NonNegativeMoney(forwardPriceNode);
             }
         }
         else
         {
             forwardPrice_ = new NonNegativeMoney(forwardPriceNode);
         }
     }
     
 
 }
        public EquityForward(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode forwardPriceNode = xmlNode.SelectSingleNode("forwardPrice");

            if (forwardPriceNode != null)
            {
                if (forwardPriceNode.Attributes["href"] != null || forwardPriceNode.Attributes["id"] != null)
                {
                    if (forwardPriceNode.Attributes["id"] != null)
                    {
                        forwardPriceIDRef_ = forwardPriceNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(forwardPriceNode);
                        IDManager.SetID(forwardPriceIDRef_, ob);
                    }
                    else if (forwardPriceNode.Attributes["href"] != null)
                    {
                        forwardPriceIDRef_ = forwardPriceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        forwardPrice_ = new NonNegativeMoney(forwardPriceNode);
                    }
                }
                else
                {
                    forwardPrice_ = new NonNegativeMoney(forwardPriceNode);
                }
            }
        }
 public NonNegativePayment(XmlNode xmlNode)
 : base(xmlNode)
 {
     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);
         }
     }
     
 
 }
Example #9
0
        public NonNegativePayment(XmlNode xmlNode)
            : base(xmlNode)
        {
            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);
                }
            }
        }
 public DividendPeriodDividend(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode dividendNode = xmlNode.SelectSingleNode("dividend");
     
     if (dividendNode != null)
     {
         if (dividendNode.Attributes["href"] != null || dividendNode.Attributes["id"] != null) 
         {
             if (dividendNode.Attributes["id"] != null) 
             {
                 dividendIDRef_ = dividendNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(dividendNode);
                 IDManager.SetID(dividendIDRef_, ob);
             }
             else if (dividendNode.Attributes["href"] != null)
             {
                 dividendIDRef_ = dividendNode.Attributes["href"].Value;
             }
             else
             {
                 dividend_ = new NonNegativeMoney(dividendNode);
             }
         }
         else
         {
             dividend_ = new NonNegativeMoney(dividendNode);
         }
     }
     
 
     XmlNode multiplierNode = xmlNode.SelectSingleNode("multiplier");
     
     if (multiplierNode != null)
     {
         if (multiplierNode.Attributes["href"] != null || multiplierNode.Attributes["id"] != null) 
         {
             if (multiplierNode.Attributes["id"] != null) 
             {
                 multiplierIDRef_ = multiplierNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(multiplierNode);
                 IDManager.SetID(multiplierIDRef_, ob);
             }
             else if (multiplierNode.Attributes["href"] != null)
             {
                 multiplierIDRef_ = multiplierNode.Attributes["href"].Value;
             }
             else
             {
                 multiplier_ = new PositiveDecimal(multiplierNode);
             }
         }
         else
         {
             multiplier_ = new PositiveDecimal(multiplierNode);
         }
     }
     
 
 }
Example #11
0
        public CommodityPremium(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList premiumPerUnitNodeList = xmlNode.SelectNodes("premiumPerUnit");

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

            foreach (XmlNode item in premiumPerUnitNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        premiumPerUnitIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(premiumPerUnitIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumPerUnitIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premiumPerUnit = new NonNegativeMoney(item);
                    }
                }
            }
        }
 public CommodityPremium(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode premiumPerUnitNode = xmlNode.SelectSingleNode("premiumPerUnit");
     
     if (premiumPerUnitNode != null)
     {
         if (premiumPerUnitNode.Attributes["href"] != null || premiumPerUnitNode.Attributes["id"] != null) 
         {
             if (premiumPerUnitNode.Attributes["id"] != null) 
             {
                 premiumPerUnitIDRef_ = premiumPerUnitNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(premiumPerUnitNode);
                 IDManager.SetID(premiumPerUnitIDRef_, ob);
             }
             else if (premiumPerUnitNode.Attributes["href"] != null)
             {
                 premiumPerUnitIDRef_ = premiumPerUnitNode.Attributes["href"].Value;
             }
             else
             {
                 premiumPerUnit_ = new NonNegativeMoney(premiumPerUnitNode);
             }
         }
         else
         {
             premiumPerUnit_ = new NonNegativeMoney(premiumPerUnitNode);
         }
     }
     
 
 }
 public EquityForward(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList forwardPriceNodeList = xmlNode.SelectNodes("forwardPrice");
     if (forwardPriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in forwardPriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 forwardPriceIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(forwardPriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 forwardPriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 forwardPrice = new NonNegativeMoney(item);
             }
         }
     }
     
 
 }
Example #14
0
 public DividendPeriodDividend(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList dividendNodeList = xmlNode.SelectNodes("dividend");
     if (dividendNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dividendNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dividendIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(dividendIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dividendIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dividend = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList multiplierNodeList = xmlNode.SelectNodes("multiplier");
     if (multiplierNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in multiplierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 multiplierIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(multiplierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 multiplierIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 multiplier = new PositiveDecimal(item);
             }
         }
     }
     
 
 }
        public AdditionalPaymentAmount(XmlNode xmlNode)
        {
            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 formulaNodeList = xmlNode.SelectNodes("formula");

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

            foreach (XmlNode item in formulaNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        formulaIDRef = item.Attributes["id"].Name;
                        Formula ob = Formula();
                        IDManager.SetID(formulaIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        formulaIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        formula = new Formula(item);
                    }
                }
            }
        }
 public EquityOptionTermination(XmlNode xmlNode)
 {
     XmlNodeList settlementAmountPaymentDateNodeList = xmlNode.SelectNodes("settlementAmountPaymentDate");
     if (settlementAmountPaymentDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementAmountPaymentDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementAmountPaymentDateIDRef = item.Attributes["id"].Name;
                 AdjustableDate ob = AdjustableDate();
                 IDManager.SetID(settlementAmountPaymentDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementAmountPaymentDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementAmountPaymentDate = new AdjustableDate(item);
             }
         }
     }
     
 
     XmlNodeList settlementAmountNodeList = xmlNode.SelectNodes("settlementAmount");
     if (settlementAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(settlementAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
 }
        public FxMultipleExercise(XmlNode xmlNode)
        {
            XmlNodeList minimumNotionalAmountNodeList = xmlNode.SelectNodes("minimumNotionalAmount");

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

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


            XmlNodeList maximumNotionalAmountNodeList = xmlNode.SelectNodes("maximumNotionalAmount");

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

            foreach (XmlNode item in maximumNotionalAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maximumNotionalAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(maximumNotionalAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maximumNotionalAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maximumNotionalAmount = new NonNegativeMoney(item);
                    }
                }
            }
        }
 public FxMultipleExercise(XmlNode xmlNode)
 {
     XmlNodeList minimumNotionalAmountNodeList = xmlNode.SelectNodes("minimumNotionalAmount");
     if (minimumNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in minimumNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 minimumNotionalAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(minimumNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 minimumNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 minimumNotionalAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList maximumNotionalAmountNodeList = xmlNode.SelectNodes("maximumNotionalAmount");
     if (maximumNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in maximumNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 maximumNotionalAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(maximumNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 maximumNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 maximumNotionalAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
 }
        public EquityOptionTermination(XmlNode xmlNode)
        {
            XmlNodeList settlementAmountPaymentDateNodeList = xmlNode.SelectNodes("settlementAmountPaymentDate");

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

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


            XmlNodeList settlementAmountNodeList = xmlNode.SelectNodes("settlementAmount");

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

            foreach (XmlNode item in settlementAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(settlementAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementAmount = new NonNegativeMoney(item);
                    }
                }
            }
        }
 public EquityOptionTermination(XmlNode xmlNode)
 {
     XmlNode settlementAmountPaymentDateNode = xmlNode.SelectSingleNode("settlementAmountPaymentDate");
     
     if (settlementAmountPaymentDateNode != null)
     {
         if (settlementAmountPaymentDateNode.Attributes["href"] != null || settlementAmountPaymentDateNode.Attributes["id"] != null) 
         {
             if (settlementAmountPaymentDateNode.Attributes["id"] != null) 
             {
                 settlementAmountPaymentDateIDRef_ = settlementAmountPaymentDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(settlementAmountPaymentDateNode);
                 IDManager.SetID(settlementAmountPaymentDateIDRef_, ob);
             }
             else if (settlementAmountPaymentDateNode.Attributes["href"] != null)
             {
                 settlementAmountPaymentDateIDRef_ = settlementAmountPaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 settlementAmountPaymentDate_ = new AdjustableDate(settlementAmountPaymentDateNode);
             }
         }
         else
         {
             settlementAmountPaymentDate_ = new AdjustableDate(settlementAmountPaymentDateNode);
         }
     }
     
 
     XmlNode settlementAmountNode = xmlNode.SelectSingleNode("settlementAmount");
     
     if (settlementAmountNode != null)
     {
         if (settlementAmountNode.Attributes["href"] != null || settlementAmountNode.Attributes["id"] != null) 
         {
             if (settlementAmountNode.Attributes["id"] != null) 
             {
                 settlementAmountIDRef_ = settlementAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(settlementAmountNode);
                 IDManager.SetID(settlementAmountIDRef_, ob);
             }
             else if (settlementAmountNode.Attributes["href"] != null)
             {
                 settlementAmountIDRef_ = settlementAmountNode.Attributes["href"].Value;
             }
             else
             {
                 settlementAmount_ = new NonNegativeMoney(settlementAmountNode);
             }
         }
         else
         {
             settlementAmount_ = new NonNegativeMoney(settlementAmountNode);
         }
     }
     
 
 }
 public FxMultipleExercise(XmlNode xmlNode)
 {
     XmlNode minimumNotionalAmountNode = xmlNode.SelectSingleNode("minimumNotionalAmount");
     
     if (minimumNotionalAmountNode != null)
     {
         if (minimumNotionalAmountNode.Attributes["href"] != null || minimumNotionalAmountNode.Attributes["id"] != null) 
         {
             if (minimumNotionalAmountNode.Attributes["id"] != null) 
             {
                 minimumNotionalAmountIDRef_ = minimumNotionalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(minimumNotionalAmountNode);
                 IDManager.SetID(minimumNotionalAmountIDRef_, ob);
             }
             else if (minimumNotionalAmountNode.Attributes["href"] != null)
             {
                 minimumNotionalAmountIDRef_ = minimumNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 minimumNotionalAmount_ = new NonNegativeMoney(minimumNotionalAmountNode);
             }
         }
         else
         {
             minimumNotionalAmount_ = new NonNegativeMoney(minimumNotionalAmountNode);
         }
     }
     
 
     XmlNode maximumNotionalAmountNode = xmlNode.SelectSingleNode("maximumNotionalAmount");
     
     if (maximumNotionalAmountNode != null)
     {
         if (maximumNotionalAmountNode.Attributes["href"] != null || maximumNotionalAmountNode.Attributes["id"] != null) 
         {
             if (maximumNotionalAmountNode.Attributes["id"] != null) 
             {
                 maximumNotionalAmountIDRef_ = maximumNotionalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(maximumNotionalAmountNode);
                 IDManager.SetID(maximumNotionalAmountIDRef_, ob);
             }
             else if (maximumNotionalAmountNode.Attributes["href"] != null)
             {
                 maximumNotionalAmountIDRef_ = maximumNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 maximumNotionalAmount_ = new NonNegativeMoney(maximumNotionalAmountNode);
             }
         }
         else
         {
             maximumNotionalAmount_ = new NonNegativeMoney(maximumNotionalAmountNode);
         }
     }
     
 
 }
 public AdditionalPaymentAmount(XmlNode xmlNode)
 {
     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 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);
         }
     }
     
 
 }
Example #23
0
        public DividendPeriodDividend(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode dividendNode = xmlNode.SelectSingleNode("dividend");

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


            XmlNode multiplierNode = xmlNode.SelectSingleNode("multiplier");

            if (multiplierNode != null)
            {
                if (multiplierNode.Attributes["href"] != null || multiplierNode.Attributes["id"] != null)
                {
                    if (multiplierNode.Attributes["id"] != null)
                    {
                        multiplierIDRef_ = multiplierNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(multiplierNode);
                        IDManager.SetID(multiplierIDRef_, ob);
                    }
                    else if (multiplierNode.Attributes["href"] != null)
                    {
                        multiplierIDRef_ = multiplierNode.Attributes["href"].Value;
                    }
                    else
                    {
                        multiplier_ = new PositiveDecimal(multiplierNode);
                    }
                }
                else
                {
                    multiplier_ = new PositiveDecimal(multiplierNode);
                }
            }
        }
        public AdditionalPaymentAmount(XmlNode xmlNode)
        {
            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 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 EquityOptionTermination(XmlNode xmlNode)
        {
            XmlNode settlementAmountPaymentDateNode = xmlNode.SelectSingleNode("settlementAmountPaymentDate");

            if (settlementAmountPaymentDateNode != null)
            {
                if (settlementAmountPaymentDateNode.Attributes["href"] != null || settlementAmountPaymentDateNode.Attributes["id"] != null)
                {
                    if (settlementAmountPaymentDateNode.Attributes["id"] != null)
                    {
                        settlementAmountPaymentDateIDRef_ = settlementAmountPaymentDateNode.Attributes["id"].Value;
                        AdjustableDate ob = new AdjustableDate(settlementAmountPaymentDateNode);
                        IDManager.SetID(settlementAmountPaymentDateIDRef_, ob);
                    }
                    else if (settlementAmountPaymentDateNode.Attributes["href"] != null)
                    {
                        settlementAmountPaymentDateIDRef_ = settlementAmountPaymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementAmountPaymentDate_ = new AdjustableDate(settlementAmountPaymentDateNode);
                    }
                }
                else
                {
                    settlementAmountPaymentDate_ = new AdjustableDate(settlementAmountPaymentDateNode);
                }
            }


            XmlNode settlementAmountNode = xmlNode.SelectSingleNode("settlementAmount");

            if (settlementAmountNode != null)
            {
                if (settlementAmountNode.Attributes["href"] != null || settlementAmountNode.Attributes["id"] != null)
                {
                    if (settlementAmountNode.Attributes["id"] != null)
                    {
                        settlementAmountIDRef_ = settlementAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(settlementAmountNode);
                        IDManager.SetID(settlementAmountIDRef_, ob);
                    }
                    else if (settlementAmountNode.Attributes["href"] != null)
                    {
                        settlementAmountIDRef_ = settlementAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementAmount_ = new NonNegativeMoney(settlementAmountNode);
                    }
                }
                else
                {
                    settlementAmount_ = new NonNegativeMoney(settlementAmountNode);
                }
            }
        }
Example #26
0
        public FxMultipleExercise(XmlNode xmlNode)
        {
            XmlNode minimumNotionalAmountNode = xmlNode.SelectSingleNode("minimumNotionalAmount");

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


            XmlNode maximumNotionalAmountNode = xmlNode.SelectSingleNode("maximumNotionalAmount");

            if (maximumNotionalAmountNode != null)
            {
                if (maximumNotionalAmountNode.Attributes["href"] != null || maximumNotionalAmountNode.Attributes["id"] != null)
                {
                    if (maximumNotionalAmountNode.Attributes["id"] != null)
                    {
                        maximumNotionalAmountIDRef_ = maximumNotionalAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(maximumNotionalAmountNode);
                        IDManager.SetID(maximumNotionalAmountIDRef_, ob);
                    }
                    else if (maximumNotionalAmountNode.Attributes["href"] != null)
                    {
                        maximumNotionalAmountIDRef_ = maximumNotionalAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        maximumNotionalAmount_ = new NonNegativeMoney(maximumNotionalAmountNode);
                    }
                }
                else
                {
                    maximumNotionalAmount_ = new NonNegativeMoney(maximumNotionalAmountNode);
                }
            }
        }
 public NonPeriodicFixedPriceLeg(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 fixedPriceNodeList = xmlNode.SelectNodes("fixedPrice");
     if (fixedPriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fixedPriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fixedPriceIDRef = item.Attributes["id"].Name;
                 FixedPrice ob = FixedPrice();
                 IDManager.SetID(fixedPriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fixedPriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fixedPrice = new FixedPrice(item);
             }
         }
     }
     
 
     XmlNodeList totalPriceNodeList = xmlNode.SelectNodes("totalPrice");
     if (totalPriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in totalPriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 totalPriceIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(totalPriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 totalPriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 totalPrice = new NonNegativeMoney(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 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 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 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 Correlation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode notionalAmountNode = xmlNode.SelectSingleNode("notionalAmount");

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


            XmlNode correlationStrikePriceNode = xmlNode.SelectSingleNode("correlationStrikePrice");

            if (correlationStrikePriceNode != null)
            {
                if (correlationStrikePriceNode.Attributes["href"] != null || correlationStrikePriceNode.Attributes["id"] != null)
                {
                    if (correlationStrikePriceNode.Attributes["id"] != null)
                    {
                        correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["id"].Value;
                        CorrelationValue ob = new CorrelationValue(correlationStrikePriceNode);
                        IDManager.SetID(correlationStrikePriceIDRef_, ob);
                    }
                    else if (correlationStrikePriceNode.Attributes["href"] != null)
                    {
                        correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode);
                    }
                }
                else
                {
                    correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode);
                }
            }


            XmlNode boundedCorrelationNode = xmlNode.SelectSingleNode("boundedCorrelation");

            if (boundedCorrelationNode != null)
            {
                if (boundedCorrelationNode.Attributes["href"] != null || boundedCorrelationNode.Attributes["id"] != null)
                {
                    if (boundedCorrelationNode.Attributes["id"] != null)
                    {
                        boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["id"].Value;
                        BoundedCorrelation ob = new BoundedCorrelation(boundedCorrelationNode);
                        IDManager.SetID(boundedCorrelationIDRef_, ob);
                    }
                    else if (boundedCorrelationNode.Attributes["href"] != null)
                    {
                        boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode);
                    }
                }
                else
                {
                    boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode);
                }
            }


            XmlNode numberOfDataSeriesNode = xmlNode.SelectSingleNode("numberOfDataSeries");

            if (numberOfDataSeriesNode != null)
            {
                if (numberOfDataSeriesNode.Attributes["href"] != null || numberOfDataSeriesNode.Attributes["id"] != null)
                {
                    if (numberOfDataSeriesNode.Attributes["id"] != null)
                    {
                        numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["id"].Value;
                        XsdTypePositiveInteger ob = new XsdTypePositiveInteger(numberOfDataSeriesNode);
                        IDManager.SetID(numberOfDataSeriesIDRef_, ob);
                    }
                    else if (numberOfDataSeriesNode.Attributes["href"] != null)
                    {
                        numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode);
                    }
                }
                else
                {
                    numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode);
                }
            }
        }
        public WeatherLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList weatherIndexLevelNodeList = xmlNode.SelectNodes("weatherIndexLevel");

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

            foreach (XmlNode item in weatherIndexLevelNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        weatherIndexLevelIDRef = item.Attributes["id"].Name;
                        WeatherIndex ob = WeatherIndex();
                        IDManager.SetID(weatherIndexLevelIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        weatherIndexLevelIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        weatherIndexLevel = new WeatherIndex(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 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 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;
                        CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                        IDManager.SetID(paymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDates = new CommodityRelativePaymentDates(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);
                    }
                }
            }
        }
        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 FxOption(XmlNode xmlNode)
            : base(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;
                        AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                        IDManager.SetID(effectiveDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        effectiveDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        effectiveDate = new AdjustableOrRelativeDate(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 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;
                        FxAmericanExercise ob = FxAmericanExercise();
                        IDManager.SetID(americanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        americanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        americanExercise = new FxAmericanExercise(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;
                        FxEuropeanExercise ob = FxEuropeanExercise();
                        IDManager.SetID(europeanExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        europeanExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        europeanExercise = new FxEuropeanExercise(item);
                    }
                }
            }


            XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure");

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

            foreach (XmlNode item in exerciseProcedureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseProcedureIDRef = item.Attributes["id"].Name;
                        ExerciseProcedure ob = ExerciseProcedure();
                        IDManager.SetID(exerciseProcedureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseProcedureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseProcedure = new ExerciseProcedure(item);
                    }
                }
            }


            XmlNodeList putCurrencyAmountNodeList = xmlNode.SelectNodes("putCurrencyAmount");

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

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


            XmlNodeList callCurrencyAmountNodeList = xmlNode.SelectNodes("callCurrencyAmount");

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

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


            XmlNodeList soldAsNodeList = xmlNode.SelectNodes("soldAs");

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

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


            XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike");

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

            foreach (XmlNode item in strikeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        strikeIDRef = item.Attributes["id"].Name;
                        FxStrikePrice ob = FxStrikePrice();
                        IDManager.SetID(strikeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        strikeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        strike = new FxStrikePrice(item);
                    }
                }
            }


            XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate");

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

            foreach (XmlNode item in spotRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        spotRateIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(spotRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        spotRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        spotRate = new PositiveDecimal(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;
                        FxOptionFeatures ob = FxOptionFeatures();
                        IDManager.SetID(featuresIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        featuresIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        features = new FxOptionFeatures(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 <FxOptionPremium> ob = new List <FxOptionPremium>();
                        ob.Add(new FxOptionPremium(item));
                        IDManager.SetID(premiumIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premium.Add(new FxOptionPremium(item));
                    }
                }
            }


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

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

            foreach (XmlNode item in cashSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashSettlementIDRef = item.Attributes["id"].Name;
                        FxCashSettlement ob = FxCashSettlement();
                        IDManager.SetID(cashSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashSettlement = new FxCashSettlement(item);
                    }
                }
            }
        }
 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);
             }
         }
     }
     
 
 }
 public PrincipalExchangeAmount(XmlNode xmlNode)
 {
     XmlNodeList amountRelativeToNodeList = xmlNode.SelectNodes("amountRelativeTo");
     if (amountRelativeToNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in amountRelativeToNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 amountRelativeToIDRef = item.Attributes["id"].Name;
                 AmountReference ob = AmountReference();
                 IDManager.SetID(amountRelativeToIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 amountRelativeToIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 amountRelativeTo = new AmountReference(item);
             }
         }
     }
     
 
     XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod");
     if (determinationMethodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in determinationMethodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 determinationMethodIDRef = item.Attributes["id"].Name;
                 DeterminationMethod ob = DeterminationMethod();
                 IDManager.SetID(determinationMethodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 determinationMethodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 determinationMethod = new DeterminationMethod(item);
             }
         }
     }
     
 
     XmlNodeList principalAmountNodeList = xmlNode.SelectNodes("principalAmount");
     if (principalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in principalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 principalAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(principalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 principalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 principalAmount = new NonNegativeMoney(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 PrePayment(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 prePaymentNode = xmlNode.SelectSingleNode("prePayment");
     
     if (prePaymentNode != null)
     {
         if (prePaymentNode.Attributes["href"] != null || prePaymentNode.Attributes["id"] != null) 
         {
             if (prePaymentNode.Attributes["id"] != null) 
             {
                 prePaymentIDRef_ = prePaymentNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(prePaymentNode);
                 IDManager.SetID(prePaymentIDRef_, ob);
             }
             else if (prePaymentNode.Attributes["href"] != null)
             {
                 prePaymentIDRef_ = prePaymentNode.Attributes["href"].Value;
             }
             else
             {
                 prePayment_ = new XsdTypeBoolean(prePaymentNode);
             }
         }
         else
         {
             prePayment_ = new XsdTypeBoolean(prePaymentNode);
         }
     }
     
 
     XmlNode prePaymentAmountNode = xmlNode.SelectSingleNode("prePaymentAmount");
     
     if (prePaymentAmountNode != null)
     {
         if (prePaymentAmountNode.Attributes["href"] != null || prePaymentAmountNode.Attributes["id"] != null) 
         {
             if (prePaymentAmountNode.Attributes["id"] != null) 
             {
                 prePaymentAmountIDRef_ = prePaymentAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(prePaymentAmountNode);
                 IDManager.SetID(prePaymentAmountIDRef_, ob);
             }
             else if (prePaymentAmountNode.Attributes["href"] != null)
             {
                 prePaymentAmountIDRef_ = prePaymentAmountNode.Attributes["href"].Value;
             }
             else
             {
                 prePaymentAmount_ = new NonNegativeMoney(prePaymentAmountNode);
             }
         }
         else
         {
             prePaymentAmount_ = new NonNegativeMoney(prePaymentAmountNode);
         }
     }
     
 
     XmlNode prePaymentDateNode = xmlNode.SelectSingleNode("prePaymentDate");
     
     if (prePaymentDateNode != null)
     {
         if (prePaymentDateNode.Attributes["href"] != null || prePaymentDateNode.Attributes["id"] != null) 
         {
             if (prePaymentDateNode.Attributes["id"] != null) 
             {
                 prePaymentDateIDRef_ = prePaymentDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(prePaymentDateNode);
                 IDManager.SetID(prePaymentDateIDRef_, ob);
             }
             else if (prePaymentDateNode.Attributes["href"] != null)
             {
                 prePaymentDateIDRef_ = prePaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 prePaymentDate_ = new AdjustableDate(prePaymentDateNode);
             }
         }
         else
         {
             prePaymentDate_ = new AdjustableDate(prePaymentDateNode);
         }
     }
     
 
 }
 public Correlation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount");
     if (notionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(notionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList correlationStrikePriceNodeList = xmlNode.SelectNodes("correlationStrikePrice");
     if (correlationStrikePriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in correlationStrikePriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 correlationStrikePriceIDRef = item.Attributes["id"].Name;
                 CorrelationValue ob = CorrelationValue();
                 IDManager.SetID(correlationStrikePriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 correlationStrikePriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 correlationStrikePrice = new CorrelationValue(item);
             }
         }
     }
     
 
     XmlNodeList boundedCorrelationNodeList = xmlNode.SelectNodes("boundedCorrelation");
     if (boundedCorrelationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in boundedCorrelationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 boundedCorrelationIDRef = item.Attributes["id"].Name;
                 BoundedCorrelation ob = BoundedCorrelation();
                 IDManager.SetID(boundedCorrelationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 boundedCorrelationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 boundedCorrelation = new BoundedCorrelation(item);
             }
         }
     }
     
 
     XmlNodeList numberOfDataSeriesNodeList = xmlNode.SelectNodes("numberOfDataSeries");
     if (numberOfDataSeriesNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in numberOfDataSeriesNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 numberOfDataSeriesIDRef = item.Attributes["id"].Name;
                 XsdTypePositiveInteger ob = XsdTypePositiveInteger();
                 IDManager.SetID(numberOfDataSeriesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 numberOfDataSeriesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 numberOfDataSeries = new XsdTypePositiveInteger(item);
             }
         }
     }
     
 
 }
 public Variance(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList varianceAmountNodeList = xmlNode.SelectNodes("varianceAmount");
     if (varianceAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in varianceAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 varianceAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(varianceAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 varianceAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 varianceAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList volatilityStrikePriceNodeList = xmlNode.SelectNodes("volatilityStrikePrice");
     if (volatilityStrikePriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in volatilityStrikePriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 volatilityStrikePriceIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(volatilityStrikePriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 volatilityStrikePriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 volatilityStrikePrice = new NonNegativeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList varianceStrikePriceNodeList = xmlNode.SelectNodes("varianceStrikePrice");
     if (varianceStrikePriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in varianceStrikePriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 varianceStrikePriceIDRef = item.Attributes["id"].Name;
                 NonNegativeDecimal ob = NonNegativeDecimal();
                 IDManager.SetID(varianceStrikePriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 varianceStrikePriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 varianceStrikePrice = new NonNegativeDecimal(item);
             }
         }
     }
     
 
     XmlNodeList varianceCapNodeList = xmlNode.SelectNodes("varianceCap");
     if (varianceCapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in varianceCapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 varianceCapIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(varianceCapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 varianceCapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 varianceCap = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList unadjustedVarianceCapNodeList = xmlNode.SelectNodes("unadjustedVarianceCap");
     if (unadjustedVarianceCapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in unadjustedVarianceCapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 unadjustedVarianceCapIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(unadjustedVarianceCapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 unadjustedVarianceCapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 unadjustedVarianceCap = new PositiveDecimal(item);
             }
         }
     }
     
 
     XmlNodeList boundedVarianceNodeList = xmlNode.SelectNodes("boundedVariance");
     if (boundedVarianceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in boundedVarianceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 boundedVarianceIDRef = item.Attributes["id"].Name;
                 BoundedVariance ob = BoundedVariance();
                 IDManager.SetID(boundedVarianceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 boundedVarianceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 boundedVariance = new BoundedVariance(item);
             }
         }
     }
     
 
     XmlNodeList exchangeTradedContractNearestNodeList = xmlNode.SelectNodes("exchangeTradedContractNearest");
     if (exchangeTradedContractNearestNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeTradedContractNearestNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeTradedContractNearestIDRef = item.Attributes["id"].Name;
                 ExchangeTradedContract ob = ExchangeTradedContract();
                 IDManager.SetID(exchangeTradedContractNearestIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeTradedContractNearestIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeTradedContractNearest = new ExchangeTradedContract(item);
             }
         }
     }
     
 
     XmlNodeList vegaNotionalAmountNodeList = xmlNode.SelectNodes("vegaNotionalAmount");
     if (vegaNotionalAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in vegaNotionalAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 vegaNotionalAmountIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(vegaNotionalAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 vegaNotionalAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 vegaNotionalAmount = new XsdTypeDecimal(item);
             }
         }
     }
     
 
 }
 public WeatherLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList weatherIndexLevelNodeList = xmlNode.SelectNodes("weatherIndexLevel");
     if (weatherIndexLevelNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in weatherIndexLevelNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 weatherIndexLevelIDRef = item.Attributes["id"].Name;
                 WeatherIndex ob = WeatherIndex();
                 IDManager.SetID(weatherIndexLevelIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 weatherIndexLevelIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 weatherIndexLevel = new WeatherIndex(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 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 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;
                 CommodityRelativePaymentDates ob = CommodityRelativePaymentDates();
                 IDManager.SetID(paymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDates = new CommodityRelativePaymentDates(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);
             }
         }
     }
     
 
 }
 public FxOption(XmlNode xmlNode)
 : base(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;
                 AdjustableOrRelativeDate ob = AdjustableOrRelativeDate();
                 IDManager.SetID(effectiveDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 effectiveDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 effectiveDate = new AdjustableOrRelativeDate(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 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;
                 FxAmericanExercise ob = FxAmericanExercise();
                 IDManager.SetID(americanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 americanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 americanExercise = new FxAmericanExercise(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;
                 FxEuropeanExercise ob = FxEuropeanExercise();
                 IDManager.SetID(europeanExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 europeanExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 europeanExercise = new FxEuropeanExercise(item);
             }
         }
     }
     
 
     XmlNodeList exerciseProcedureNodeList = xmlNode.SelectNodes("exerciseProcedure");
     if (exerciseProcedureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exerciseProcedureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exerciseProcedureIDRef = item.Attributes["id"].Name;
                 ExerciseProcedure ob = ExerciseProcedure();
                 IDManager.SetID(exerciseProcedureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exerciseProcedureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exerciseProcedure = new ExerciseProcedure(item);
             }
         }
     }
     
 
     XmlNodeList putCurrencyAmountNodeList = xmlNode.SelectNodes("putCurrencyAmount");
     if (putCurrencyAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in putCurrencyAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 putCurrencyAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(putCurrencyAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 putCurrencyAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 putCurrencyAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList callCurrencyAmountNodeList = xmlNode.SelectNodes("callCurrencyAmount");
     if (callCurrencyAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in callCurrencyAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 callCurrencyAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(callCurrencyAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 callCurrencyAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 callCurrencyAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList soldAsNodeList = xmlNode.SelectNodes("soldAs");
     if (soldAsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in soldAsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 soldAsIDRef = item.Attributes["id"].Name;
                 PutCallEnum ob = PutCallEnum();
                 IDManager.SetID(soldAsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 soldAsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 soldAs = new PutCallEnum(item);
             }
         }
     }
     
 
     XmlNodeList strikeNodeList = xmlNode.SelectNodes("strike");
     if (strikeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in strikeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 strikeIDRef = item.Attributes["id"].Name;
                 FxStrikePrice ob = FxStrikePrice();
                 IDManager.SetID(strikeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 strikeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 strike = new FxStrikePrice(item);
             }
         }
     }
     
 
     XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate");
     if (spotRateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in spotRateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 spotRateIDRef = item.Attributes["id"].Name;
                 PositiveDecimal ob = PositiveDecimal();
                 IDManager.SetID(spotRateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 spotRateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 spotRate = new PositiveDecimal(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;
                 FxOptionFeatures ob = FxOptionFeatures();
                 IDManager.SetID(featuresIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 featuresIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 features = new FxOptionFeatures(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<FxOptionPremium> ob = new List<FxOptionPremium>();
                 ob.Add(new FxOptionPremium(item));
                 IDManager.SetID(premiumIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 premiumIDRef = item.Attributes["href"].Name;
             }
             else
             {
             premium.Add(new FxOptionPremium(item));
             }
         }
     }
     
 
     XmlNodeList cashSettlementNodeList = xmlNode.SelectNodes("cashSettlement");
     if (cashSettlementNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashSettlementNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashSettlementIDRef = item.Attributes["id"].Name;
                 FxCashSettlement ob = FxCashSettlement();
                 IDManager.SetID(cashSettlementIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashSettlementIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cashSettlement = new FxCashSettlement(item);
             }
         }
     }
     
 
 }
        public EquityPremium(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 premiumTypeNode = xmlNode.SelectSingleNode("premiumType");

            if (premiumTypeNode != null)
            {
                if (premiumTypeNode.Attributes["href"] != null || premiumTypeNode.Attributes["id"] != null)
                {
                    if (premiumTypeNode.Attributes["id"] != null)
                    {
                        premiumTypeIDRef_ = premiumTypeNode.Attributes["id"].Value;
                        PremiumTypeEnum ob = new PremiumTypeEnum(premiumTypeNode);
                        IDManager.SetID(premiumTypeIDRef_, ob);
                    }
                    else if (premiumTypeNode.Attributes["href"] != null)
                    {
                        premiumTypeIDRef_ = premiumTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        premiumType_ = new PremiumTypeEnum(premiumTypeNode);
                    }
                }
                else
                {
                    premiumType_ = new PremiumTypeEnum(premiumTypeNode);
                }
            }


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


            XmlNode swapPremiumNode = xmlNode.SelectSingleNode("swapPremium");

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


            XmlNode pricePerOptionNode = xmlNode.SelectSingleNode("pricePerOption");

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


            XmlNode percentageOfNotionalNode = xmlNode.SelectSingleNode("percentageOfNotional");

            if (percentageOfNotionalNode != null)
            {
                if (percentageOfNotionalNode.Attributes["href"] != null || percentageOfNotionalNode.Attributes["id"] != null)
                {
                    if (percentageOfNotionalNode.Attributes["id"] != null)
                    {
                        percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(percentageOfNotionalNode);
                        IDManager.SetID(percentageOfNotionalIDRef_, ob);
                    }
                    else if (percentageOfNotionalNode.Attributes["href"] != null)
                    {
                        percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
                    }
                }
                else
                {
                    percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
                }
            }
        }
        public PrincipalExchangeAmount(XmlNode xmlNode)
        {
            XmlNode amountRelativeToNode = xmlNode.SelectSingleNode("amountRelativeTo");

            if (amountRelativeToNode != null)
            {
                if (amountRelativeToNode.Attributes["href"] != null || amountRelativeToNode.Attributes["id"] != null)
                {
                    if (amountRelativeToNode.Attributes["id"] != null)
                    {
                        amountRelativeToIDRef_ = amountRelativeToNode.Attributes["id"].Value;
                        AmountReference ob = new AmountReference(amountRelativeToNode);
                        IDManager.SetID(amountRelativeToIDRef_, ob);
                    }
                    else if (amountRelativeToNode.Attributes["href"] != null)
                    {
                        amountRelativeToIDRef_ = amountRelativeToNode.Attributes["href"].Value;
                    }
                    else
                    {
                        amountRelativeTo_ = new AmountReference(amountRelativeToNode);
                    }
                }
                else
                {
                    amountRelativeTo_ = new AmountReference(amountRelativeToNode);
                }
            }


            XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");

            if (determinationMethodNode != null)
            {
                if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null)
                {
                    if (determinationMethodNode.Attributes["id"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                        DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                        IDManager.SetID(determinationMethodIDRef_, ob);
                    }
                    else if (determinationMethodNode.Attributes["href"] != null)
                    {
                        determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                    }
                }
                else
                {
                    determinationMethod_ = new DeterminationMethod(determinationMethodNode);
                }
            }


            XmlNode principalAmountNode = xmlNode.SelectSingleNode("principalAmount");

            if (principalAmountNode != null)
            {
                if (principalAmountNode.Attributes["href"] != null || principalAmountNode.Attributes["id"] != null)
                {
                    if (principalAmountNode.Attributes["id"] != null)
                    {
                        principalAmountIDRef_ = principalAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(principalAmountNode);
                        IDManager.SetID(principalAmountIDRef_, ob);
                    }
                    else if (principalAmountNode.Attributes["href"] != null)
                    {
                        principalAmountIDRef_ = principalAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        principalAmount_ = new NonNegativeMoney(principalAmountNode);
                    }
                }
                else
                {
                    principalAmount_ = new NonNegativeMoney(principalAmountNode);
                }
            }
        }
Example #44
0
        public FloatingPriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates");

            if (calculationDatesNode != null)
            {
                if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null)
                {
                    if (calculationDatesNode.Attributes["id"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value;
                        AdjustableDates ob = new AdjustableDates(calculationDatesNode);
                        IDManager.SetID(calculationDatesIDRef_, ob);
                    }
                    else if (calculationDatesNode.Attributes["href"] != null)
                    {
                        calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationDates_ = new AdjustableDates(calculationDatesNode);
                    }
                }
                else
                {
                    calculationDates_ = new AdjustableDates(calculationDatesNode);
                }
            }


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

            if (calculationPeriodsReferenceNode != null)
            {
                if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                        IDManager.SetID(calculationPeriodsReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode);
                }
            }


            XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference");

            if (calculationPeriodsScheduleReferenceNode != null)
            {
                if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                        IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode);
                }
            }


            XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference");

            if (calculationPeriodsDatesReferenceNode != null)
            {
                if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value;
                        CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                        IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode);
                }
            }


            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 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 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;
                        FloatingLegCalculation ob = new FloatingLegCalculation(calculationNode);
                        IDManager.SetID(calculationIDRef_, ob);
                    }
                    else if (calculationNode.Attributes["href"] != null)
                    {
                        calculationIDRef_ = calculationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculation_ = new FloatingLegCalculation(calculationNode);
                    }
                }
                else
                {
                    calculation_ = new FloatingLegCalculation(calculationNode);
                }
            }


            XmlNode relativePaymentDatesNode = xmlNode.SelectSingleNode("relativePaymentDates");

            if (relativePaymentDatesNode != null)
            {
                if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null)
                {
                    if (relativePaymentDatesNode.Attributes["id"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                        CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                        IDManager.SetID(relativePaymentDatesIDRef_, ob);
                    }
                    else if (relativePaymentDatesNode.Attributes["href"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                    }
                }
                else
                {
                    relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                }
            }


            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;
                        AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                        IDManager.SetID(paymentDatesIDRef_, ob);
                    }
                    else if (paymentDatesNode.Attributes["href"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                    }
                }
                else
                {
                    paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                }
            }


            XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");

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


            XmlNode flatRateNode = xmlNode.SelectSingleNode("flatRate");

            if (flatRateNode != null)
            {
                if (flatRateNode.Attributes["href"] != null || flatRateNode.Attributes["id"] != null)
                {
                    if (flatRateNode.Attributes["id"] != null)
                    {
                        flatRateIDRef_ = flatRateNode.Attributes["id"].Value;
                        FlatRateEnum ob = new FlatRateEnum(flatRateNode);
                        IDManager.SetID(flatRateIDRef_, ob);
                    }
                    else if (flatRateNode.Attributes["href"] != null)
                    {
                        flatRateIDRef_ = flatRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        flatRate_ = new FlatRateEnum(flatRateNode);
                    }
                }
                else
                {
                    flatRate_ = new FlatRateEnum(flatRateNode);
                }
            }


            XmlNode flatRateAmountNode = xmlNode.SelectSingleNode("flatRateAmount");

            if (flatRateAmountNode != null)
            {
                if (flatRateAmountNode.Attributes["href"] != null || flatRateAmountNode.Attributes["id"] != null)
                {
                    if (flatRateAmountNode.Attributes["id"] != null)
                    {
                        flatRateAmountIDRef_ = flatRateAmountNode.Attributes["id"].Value;
                        NonNegativeMoney ob = new NonNegativeMoney(flatRateAmountNode);
                        IDManager.SetID(flatRateAmountIDRef_, ob);
                    }
                    else if (flatRateAmountNode.Attributes["href"] != null)
                    {
                        flatRateAmountIDRef_ = flatRateAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
                    }
                }
                else
                {
                    flatRateAmount_ = new NonNegativeMoney(flatRateAmountNode);
                }
            }
        }
Example #45
0
        public Variance(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode varianceAmountNode = xmlNode.SelectSingleNode("varianceAmount");

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


            XmlNode volatilityStrikePriceNode = xmlNode.SelectSingleNode("volatilityStrikePrice");

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


            XmlNode varianceStrikePriceNode = xmlNode.SelectSingleNode("varianceStrikePrice");

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


            XmlNode varianceCapNode = xmlNode.SelectSingleNode("varianceCap");

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


            XmlNode unadjustedVarianceCapNode = xmlNode.SelectSingleNode("unadjustedVarianceCap");

            if (unadjustedVarianceCapNode != null)
            {
                if (unadjustedVarianceCapNode.Attributes["href"] != null || unadjustedVarianceCapNode.Attributes["id"] != null)
                {
                    if (unadjustedVarianceCapNode.Attributes["id"] != null)
                    {
                        unadjustedVarianceCapIDRef_ = unadjustedVarianceCapNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(unadjustedVarianceCapNode);
                        IDManager.SetID(unadjustedVarianceCapIDRef_, ob);
                    }
                    else if (unadjustedVarianceCapNode.Attributes["href"] != null)
                    {
                        unadjustedVarianceCapIDRef_ = unadjustedVarianceCapNode.Attributes["href"].Value;
                    }
                    else
                    {
                        unadjustedVarianceCap_ = new PositiveDecimal(unadjustedVarianceCapNode);
                    }
                }
                else
                {
                    unadjustedVarianceCap_ = new PositiveDecimal(unadjustedVarianceCapNode);
                }
            }


            XmlNode boundedVarianceNode = xmlNode.SelectSingleNode("boundedVariance");

            if (boundedVarianceNode != null)
            {
                if (boundedVarianceNode.Attributes["href"] != null || boundedVarianceNode.Attributes["id"] != null)
                {
                    if (boundedVarianceNode.Attributes["id"] != null)
                    {
                        boundedVarianceIDRef_ = boundedVarianceNode.Attributes["id"].Value;
                        BoundedVariance ob = new BoundedVariance(boundedVarianceNode);
                        IDManager.SetID(boundedVarianceIDRef_, ob);
                    }
                    else if (boundedVarianceNode.Attributes["href"] != null)
                    {
                        boundedVarianceIDRef_ = boundedVarianceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        boundedVariance_ = new BoundedVariance(boundedVarianceNode);
                    }
                }
                else
                {
                    boundedVariance_ = new BoundedVariance(boundedVarianceNode);
                }
            }


            XmlNode exchangeTradedContractNearestNode = xmlNode.SelectSingleNode("exchangeTradedContractNearest");

            if (exchangeTradedContractNearestNode != null)
            {
                if (exchangeTradedContractNearestNode.Attributes["href"] != null || exchangeTradedContractNearestNode.Attributes["id"] != null)
                {
                    if (exchangeTradedContractNearestNode.Attributes["id"] != null)
                    {
                        exchangeTradedContractNearestIDRef_ = exchangeTradedContractNearestNode.Attributes["id"].Value;
                        ExchangeTradedContract ob = new ExchangeTradedContract(exchangeTradedContractNearestNode);
                        IDManager.SetID(exchangeTradedContractNearestIDRef_, ob);
                    }
                    else if (exchangeTradedContractNearestNode.Attributes["href"] != null)
                    {
                        exchangeTradedContractNearestIDRef_ = exchangeTradedContractNearestNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangeTradedContractNearest_ = new ExchangeTradedContract(exchangeTradedContractNearestNode);
                    }
                }
                else
                {
                    exchangeTradedContractNearest_ = new ExchangeTradedContract(exchangeTradedContractNearestNode);
                }
            }


            XmlNode vegaNotionalAmountNode = xmlNode.SelectSingleNode("vegaNotionalAmount");

            if (vegaNotionalAmountNode != null)
            {
                if (vegaNotionalAmountNode.Attributes["href"] != null || vegaNotionalAmountNode.Attributes["id"] != null)
                {
                    if (vegaNotionalAmountNode.Attributes["id"] != null)
                    {
                        vegaNotionalAmountIDRef_ = vegaNotionalAmountNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(vegaNotionalAmountNode);
                        IDManager.SetID(vegaNotionalAmountIDRef_, ob);
                    }
                    else if (vegaNotionalAmountNode.Attributes["href"] != null)
                    {
                        vegaNotionalAmountIDRef_ = vegaNotionalAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        vegaNotionalAmount_ = new XsdTypeDecimal(vegaNotionalAmountNode);
                    }
                }
                else
                {
                    vegaNotionalAmount_ = new XsdTypeDecimal(vegaNotionalAmountNode);
                }
            }
        }
 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 WeatherLegCalculation(XmlNode xmlNode)
        {
            XmlNodeList settlementLevelNodeList = xmlNode.SelectNodes("settlementLevel");

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

            foreach (XmlNode item in settlementLevelNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementLevelIDRef = item.Attributes["id"].Name;
                        WeatherSettlementLevelEnum ob = WeatherSettlementLevelEnum();
                        IDManager.SetID(settlementLevelIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementLevelIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementLevel = new WeatherSettlementLevelEnum(item);
                    }
                }
            }


            XmlNodeList referenceLevelEqualsZeroNodeList = xmlNode.SelectNodes("referenceLevelEqualsZero");

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

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


            XmlNodeList calculationDateNodeList = xmlNode.SelectNodes("calculationDate");

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

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


            XmlNodeList businessDaysNodeList = xmlNode.SelectNodes("businessDays");

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

            foreach (XmlNode item in businessDaysNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        businessDaysIDRef = item.Attributes["id"].Name;
                        BusinessCenter ob = BusinessCenter();
                        IDManager.SetID(businessDaysIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        businessDaysIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        businessDays = new BusinessCenter(item);
                    }
                }
            }


            XmlNodeList dataCorrectionNodeList = xmlNode.SelectNodes("dataCorrection");

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

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


            XmlNodeList correctionPeriodNodeList = xmlNode.SelectNodes("correctionPeriod");

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

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


            XmlNodeList maximumPaymentAmountNodeList = xmlNode.SelectNodes("maximumPaymentAmount");

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

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


            XmlNodeList maximumTransactionPaymentAmountNodeList = xmlNode.SelectNodes("maximumTransactionPaymentAmount");

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

            foreach (XmlNode item in maximumTransactionPaymentAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        maximumTransactionPaymentAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(maximumTransactionPaymentAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        maximumTransactionPaymentAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        maximumTransactionPaymentAmount = new NonNegativeMoney(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 NonPeriodicFixedPriceLeg(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 fixedPriceNode = xmlNode.SelectSingleNode("fixedPrice");

            if (fixedPriceNode != null)
            {
                if (fixedPriceNode.Attributes["href"] != null || fixedPriceNode.Attributes["id"] != null)
                {
                    if (fixedPriceNode.Attributes["id"] != null)
                    {
                        fixedPriceIDRef_ = fixedPriceNode.Attributes["id"].Value;
                        FixedPrice ob = new FixedPrice(fixedPriceNode);
                        IDManager.SetID(fixedPriceIDRef_, ob);
                    }
                    else if (fixedPriceNode.Attributes["href"] != null)
                    {
                        fixedPriceIDRef_ = fixedPriceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fixedPrice_ = new FixedPrice(fixedPriceNode);
                    }
                }
                else
                {
                    fixedPrice_ = new FixedPrice(fixedPriceNode);
                }
            }


            XmlNode totalPriceNode = xmlNode.SelectSingleNode("totalPrice");

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


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

            if (relativePaymentDatesNode != null)
            {
                if (relativePaymentDatesNode.Attributes["href"] != null || relativePaymentDatesNode.Attributes["id"] != null)
                {
                    if (relativePaymentDatesNode.Attributes["id"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["id"].Value;
                        CommodityRelativePaymentDates ob = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                        IDManager.SetID(relativePaymentDatesIDRef_, ob);
                    }
                    else if (relativePaymentDatesNode.Attributes["href"] != null)
                    {
                        relativePaymentDatesIDRef_ = relativePaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                    }
                }
                else
                {
                    relativePaymentDates_ = new CommodityRelativePaymentDates(relativePaymentDatesNode);
                }
            }


            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;
                        AdjustableDatesOrRelativeDateOffset ob = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                        IDManager.SetID(paymentDatesIDRef_, ob);
                    }
                    else if (paymentDatesNode.Attributes["href"] != null)
                    {
                        paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                    }
                }
                else
                {
                    paymentDates_ = new AdjustableDatesOrRelativeDateOffset(paymentDatesNode);
                }
            }


            XmlNode masterAgreementPaymentDatesNode = xmlNode.SelectSingleNode("masterAgreementPaymentDates");

            if (masterAgreementPaymentDatesNode != null)
            {
                if (masterAgreementPaymentDatesNode.Attributes["href"] != null || masterAgreementPaymentDatesNode.Attributes["id"] != null)
                {
                    if (masterAgreementPaymentDatesNode.Attributes["id"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                        IDManager.SetID(masterAgreementPaymentDatesIDRef_, ob);
                    }
                    else if (masterAgreementPaymentDatesNode.Attributes["href"] != null)
                    {
                        masterAgreementPaymentDatesIDRef_ = masterAgreementPaymentDatesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                    }
                }
                else
                {
                    masterAgreementPaymentDates_ = new XsdTypeBoolean(masterAgreementPaymentDatesNode);
                }
            }
        }
 public EquityPremium(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 premiumTypeNode = xmlNode.SelectSingleNode("premiumType");
     
     if (premiumTypeNode != null)
     {
         if (premiumTypeNode.Attributes["href"] != null || premiumTypeNode.Attributes["id"] != null) 
         {
             if (premiumTypeNode.Attributes["id"] != null) 
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["id"].Value;
                 PremiumTypeEnum ob = new PremiumTypeEnum(premiumTypeNode);
                 IDManager.SetID(premiumTypeIDRef_, ob);
             }
             else if (premiumTypeNode.Attributes["href"] != null)
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["href"].Value;
             }
             else
             {
                 premiumType_ = new PremiumTypeEnum(premiumTypeNode);
             }
         }
         else
         {
             premiumType_ = new PremiumTypeEnum(premiumTypeNode);
         }
     }
     
 
     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;
                 AdjustableDate ob = new AdjustableDate(paymentDateNode);
                 IDManager.SetID(paymentDateIDRef_, ob);
             }
             else if (paymentDateNode.Attributes["href"] != null)
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDate_ = new AdjustableDate(paymentDateNode);
             }
         }
         else
         {
             paymentDate_ = new AdjustableDate(paymentDateNode);
         }
     }
     
 
     XmlNode swapPremiumNode = xmlNode.SelectSingleNode("swapPremium");
     
     if (swapPremiumNode != null)
     {
         if (swapPremiumNode.Attributes["href"] != null || swapPremiumNode.Attributes["id"] != null) 
         {
             if (swapPremiumNode.Attributes["id"] != null) 
             {
                 swapPremiumIDRef_ = swapPremiumNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(swapPremiumNode);
                 IDManager.SetID(swapPremiumIDRef_, ob);
             }
             else if (swapPremiumNode.Attributes["href"] != null)
             {
                 swapPremiumIDRef_ = swapPremiumNode.Attributes["href"].Value;
             }
             else
             {
                 swapPremium_ = new XsdTypeBoolean(swapPremiumNode);
             }
         }
         else
         {
             swapPremium_ = new XsdTypeBoolean(swapPremiumNode);
         }
     }
     
 
     XmlNode pricePerOptionNode = xmlNode.SelectSingleNode("pricePerOption");
     
     if (pricePerOptionNode != null)
     {
         if (pricePerOptionNode.Attributes["href"] != null || pricePerOptionNode.Attributes["id"] != null) 
         {
             if (pricePerOptionNode.Attributes["id"] != null) 
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(pricePerOptionNode);
                 IDManager.SetID(pricePerOptionIDRef_, ob);
             }
             else if (pricePerOptionNode.Attributes["href"] != null)
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["href"].Value;
             }
             else
             {
                 pricePerOption_ = new NonNegativeMoney(pricePerOptionNode);
             }
         }
         else
         {
             pricePerOption_ = new NonNegativeMoney(pricePerOptionNode);
         }
     }
     
 
     XmlNode percentageOfNotionalNode = xmlNode.SelectSingleNode("percentageOfNotional");
     
     if (percentageOfNotionalNode != null)
     {
         if (percentageOfNotionalNode.Attributes["href"] != null || percentageOfNotionalNode.Attributes["id"] != null) 
         {
             if (percentageOfNotionalNode.Attributes["id"] != null) 
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(percentageOfNotionalNode);
                 IDManager.SetID(percentageOfNotionalIDRef_, ob);
             }
             else if (percentageOfNotionalNode.Attributes["href"] != null)
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["href"].Value;
             }
             else
             {
                 percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
             }
         }
         else
         {
             percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
         }
     }
     
 
 }
 public Correlation(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode notionalAmountNode = xmlNode.SelectSingleNode("notionalAmount");
     
     if (notionalAmountNode != null)
     {
         if (notionalAmountNode.Attributes["href"] != null || notionalAmountNode.Attributes["id"] != null) 
         {
             if (notionalAmountNode.Attributes["id"] != null) 
             {
                 notionalAmountIDRef_ = notionalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(notionalAmountNode);
                 IDManager.SetID(notionalAmountIDRef_, ob);
             }
             else if (notionalAmountNode.Attributes["href"] != null)
             {
                 notionalAmountIDRef_ = notionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 notionalAmount_ = new NonNegativeMoney(notionalAmountNode);
             }
         }
         else
         {
             notionalAmount_ = new NonNegativeMoney(notionalAmountNode);
         }
     }
     
 
     XmlNode correlationStrikePriceNode = xmlNode.SelectSingleNode("correlationStrikePrice");
     
     if (correlationStrikePriceNode != null)
     {
         if (correlationStrikePriceNode.Attributes["href"] != null || correlationStrikePriceNode.Attributes["id"] != null) 
         {
             if (correlationStrikePriceNode.Attributes["id"] != null) 
             {
                 correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["id"].Value;
                 CorrelationValue ob = new CorrelationValue(correlationStrikePriceNode);
                 IDManager.SetID(correlationStrikePriceIDRef_, ob);
             }
             else if (correlationStrikePriceNode.Attributes["href"] != null)
             {
                 correlationStrikePriceIDRef_ = correlationStrikePriceNode.Attributes["href"].Value;
             }
             else
             {
                 correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode);
             }
         }
         else
         {
             correlationStrikePrice_ = new CorrelationValue(correlationStrikePriceNode);
         }
     }
     
 
     XmlNode boundedCorrelationNode = xmlNode.SelectSingleNode("boundedCorrelation");
     
     if (boundedCorrelationNode != null)
     {
         if (boundedCorrelationNode.Attributes["href"] != null || boundedCorrelationNode.Attributes["id"] != null) 
         {
             if (boundedCorrelationNode.Attributes["id"] != null) 
             {
                 boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["id"].Value;
                 BoundedCorrelation ob = new BoundedCorrelation(boundedCorrelationNode);
                 IDManager.SetID(boundedCorrelationIDRef_, ob);
             }
             else if (boundedCorrelationNode.Attributes["href"] != null)
             {
                 boundedCorrelationIDRef_ = boundedCorrelationNode.Attributes["href"].Value;
             }
             else
             {
                 boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode);
             }
         }
         else
         {
             boundedCorrelation_ = new BoundedCorrelation(boundedCorrelationNode);
         }
     }
     
 
     XmlNode numberOfDataSeriesNode = xmlNode.SelectSingleNode("numberOfDataSeries");
     
     if (numberOfDataSeriesNode != null)
     {
         if (numberOfDataSeriesNode.Attributes["href"] != null || numberOfDataSeriesNode.Attributes["id"] != null) 
         {
             if (numberOfDataSeriesNode.Attributes["id"] != null) 
             {
                 numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["id"].Value;
                 XsdTypePositiveInteger ob = new XsdTypePositiveInteger(numberOfDataSeriesNode);
                 IDManager.SetID(numberOfDataSeriesIDRef_, ob);
             }
             else if (numberOfDataSeriesNode.Attributes["href"] != null)
             {
                 numberOfDataSeriesIDRef_ = numberOfDataSeriesNode.Attributes["href"].Value;
             }
             else
             {
                 numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode);
             }
         }
         else
         {
             numberOfDataSeries_ = new XsdTypePositiveInteger(numberOfDataSeriesNode);
         }
     }
     
 
 }
        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 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 FixedPriceLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            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 fixedPriceScheduleNodeList = xmlNode.SelectNodes("fixedPriceSchedule");

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

            foreach (XmlNode item in fixedPriceScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedPriceScheduleIDRef = item.Attributes["id"].Name;
                        CommodityFixedPriceSchedule ob = CommodityFixedPriceSchedule();
                        IDManager.SetID(fixedPriceScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedPriceScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedPriceSchedule = new CommodityFixedPriceSchedule(item);
                    }
                }
            }


            XmlNodeList fixedPriceNodeList = xmlNode.SelectNodes("fixedPrice");

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

            foreach (XmlNode item in fixedPriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fixedPriceIDRef = item.Attributes["id"].Name;
                        FixedPrice ob = FixedPrice();
                        IDManager.SetID(fixedPriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fixedPriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fixedPrice = new FixedPrice(item);
                    }
                }
            }


            XmlNodeList worldscaleRateNodeList = xmlNode.SelectNodes("worldscaleRate");

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

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


            XmlNodeList contractRateNodeList = xmlNode.SelectNodes("contractRate");

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

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


            XmlNodeList settlementPeriodsPriceNodeList = xmlNode.SelectNodes("settlementPeriodsPrice");

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


            XmlNodeList totalPriceNodeList = xmlNode.SelectNodes("totalPrice");

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

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


            XmlNodeList flatRateNodeList = xmlNode.SelectNodes("flatRate");

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

            foreach (XmlNode item in flatRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        flatRateIDRef = item.Attributes["id"].Name;
                        FlatRateEnum ob = FlatRateEnum();
                        IDManager.SetID(flatRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        flatRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        flatRate = new FlatRateEnum(item);
                    }
                }
            }


            XmlNodeList flatRateAmountNodeList = xmlNode.SelectNodes("flatRateAmount");

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

            foreach (XmlNode item in flatRateAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        flatRateAmountIDRef = item.Attributes["id"].Name;
                        NonNegativeMoney ob = NonNegativeMoney();
                        IDManager.SetID(flatRateAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        flatRateAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        flatRateAmount = new NonNegativeMoney(item);
                    }
                }
            }
        }
Example #54
0
        public Correlation(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList notionalAmountNodeList = xmlNode.SelectNodes("notionalAmount");

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

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


            XmlNodeList correlationStrikePriceNodeList = xmlNode.SelectNodes("correlationStrikePrice");

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

            foreach (XmlNode item in correlationStrikePriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        correlationStrikePriceIDRef = item.Attributes["id"].Name;
                        CorrelationValue ob = CorrelationValue();
                        IDManager.SetID(correlationStrikePriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        correlationStrikePriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        correlationStrikePrice = new CorrelationValue(item);
                    }
                }
            }


            XmlNodeList boundedCorrelationNodeList = xmlNode.SelectNodes("boundedCorrelation");

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

            foreach (XmlNode item in boundedCorrelationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        boundedCorrelationIDRef = item.Attributes["id"].Name;
                        BoundedCorrelation ob = BoundedCorrelation();
                        IDManager.SetID(boundedCorrelationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        boundedCorrelationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        boundedCorrelation = new BoundedCorrelation(item);
                    }
                }
            }


            XmlNodeList numberOfDataSeriesNodeList = xmlNode.SelectNodes("numberOfDataSeries");

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

            foreach (XmlNode item in numberOfDataSeriesNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        numberOfDataSeriesIDRef = item.Attributes["id"].Name;
                        XsdTypePositiveInteger ob = XsdTypePositiveInteger();
                        IDManager.SetID(numberOfDataSeriesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        numberOfDataSeriesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        numberOfDataSeries = new XsdTypePositiveInteger(item);
                    }
                }
            }
        }
        public Variance(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList varianceAmountNodeList = xmlNode.SelectNodes("varianceAmount");

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

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


            XmlNodeList volatilityStrikePriceNodeList = xmlNode.SelectNodes("volatilityStrikePrice");

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

            foreach (XmlNode item in volatilityStrikePriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        volatilityStrikePriceIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(volatilityStrikePriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        volatilityStrikePriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        volatilityStrikePrice = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList varianceStrikePriceNodeList = xmlNode.SelectNodes("varianceStrikePrice");

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

            foreach (XmlNode item in varianceStrikePriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        varianceStrikePriceIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(varianceStrikePriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        varianceStrikePriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        varianceStrikePrice = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList varianceCapNodeList = xmlNode.SelectNodes("varianceCap");

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

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


            XmlNodeList unadjustedVarianceCapNodeList = xmlNode.SelectNodes("unadjustedVarianceCap");

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

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


            XmlNodeList boundedVarianceNodeList = xmlNode.SelectNodes("boundedVariance");

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

            foreach (XmlNode item in boundedVarianceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        boundedVarianceIDRef = item.Attributes["id"].Name;
                        BoundedVariance ob = BoundedVariance();
                        IDManager.SetID(boundedVarianceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        boundedVarianceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        boundedVariance = new BoundedVariance(item);
                    }
                }
            }


            XmlNodeList exchangeTradedContractNearestNodeList = xmlNode.SelectNodes("exchangeTradedContractNearest");

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

            foreach (XmlNode item in exchangeTradedContractNearestNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangeTradedContractNearestIDRef = item.Attributes["id"].Name;
                        ExchangeTradedContract ob = ExchangeTradedContract();
                        IDManager.SetID(exchangeTradedContractNearestIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangeTradedContractNearestIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangeTradedContractNearest = new ExchangeTradedContract(item);
                    }
                }
            }


            XmlNodeList vegaNotionalAmountNodeList = xmlNode.SelectNodes("vegaNotionalAmount");

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

            foreach (XmlNode item in vegaNotionalAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        vegaNotionalAmountIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(vegaNotionalAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        vegaNotionalAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        vegaNotionalAmount = new XsdTypeDecimal(item);
                    }
                }
            }
        }
 public WeatherLegCalculation(XmlNode xmlNode)
 {
     XmlNodeList settlementLevelNodeList = xmlNode.SelectNodes("settlementLevel");
     if (settlementLevelNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in settlementLevelNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 settlementLevelIDRef = item.Attributes["id"].Name;
                 WeatherSettlementLevelEnum ob = WeatherSettlementLevelEnum();
                 IDManager.SetID(settlementLevelIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 settlementLevelIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 settlementLevel = new WeatherSettlementLevelEnum(item);
             }
         }
     }
     
 
     XmlNodeList referenceLevelEqualsZeroNodeList = xmlNode.SelectNodes("referenceLevelEqualsZero");
     if (referenceLevelEqualsZeroNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceLevelEqualsZeroNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceLevelEqualsZeroIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(referenceLevelEqualsZeroIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceLevelEqualsZeroIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceLevelEqualsZero = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList calculationDateNodeList = xmlNode.SelectNodes("calculationDate");
     if (calculationDateNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in calculationDateNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 calculationDateIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(calculationDateIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 calculationDateIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 calculationDate = new Period(item);
             }
         }
     }
     
 
     XmlNodeList businessDaysNodeList = xmlNode.SelectNodes("businessDays");
     if (businessDaysNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in businessDaysNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 businessDaysIDRef = item.Attributes["id"].Name;
                 BusinessCenter ob = BusinessCenter();
                 IDManager.SetID(businessDaysIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 businessDaysIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 businessDays = new BusinessCenter(item);
             }
         }
     }
     
 
     XmlNodeList dataCorrectionNodeList = xmlNode.SelectNodes("dataCorrection");
     if (dataCorrectionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in dataCorrectionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 dataCorrectionIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(dataCorrectionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 dataCorrectionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 dataCorrection = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList correctionPeriodNodeList = xmlNode.SelectNodes("correctionPeriod");
     if (correctionPeriodNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in correctionPeriodNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 correctionPeriodIDRef = item.Attributes["id"].Name;
                 Period ob = Period();
                 IDManager.SetID(correctionPeriodIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 correctionPeriodIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 correctionPeriod = new Period(item);
             }
         }
     }
     
 
     XmlNodeList maximumPaymentAmountNodeList = xmlNode.SelectNodes("maximumPaymentAmount");
     if (maximumPaymentAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in maximumPaymentAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 maximumPaymentAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(maximumPaymentAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 maximumPaymentAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 maximumPaymentAmount = new NonNegativeMoney(item);
             }
         }
     }
     
 
     XmlNodeList maximumTransactionPaymentAmountNodeList = xmlNode.SelectNodes("maximumTransactionPaymentAmount");
     if (maximumTransactionPaymentAmountNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in maximumTransactionPaymentAmountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 maximumTransactionPaymentAmountIDRef = item.Attributes["id"].Name;
                 NonNegativeMoney ob = NonNegativeMoney();
                 IDManager.SetID(maximumTransactionPaymentAmountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 maximumTransactionPaymentAmountIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 maximumTransactionPaymentAmount = new NonNegativeMoney(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 EquityDerivativeBase(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;
                 EquityOptionTypeEnum ob = new EquityOptionTypeEnum(optionTypeNode);
                 IDManager.SetID(optionTypeIDRef_, ob);
             }
             else if (optionTypeNode.Attributes["href"] != null)
             {
                 optionTypeIDRef_ = optionTypeNode.Attributes["href"].Value;
             }
             else
             {
                 optionType_ = new EquityOptionTypeEnum(optionTypeNode);
             }
         }
         else
         {
             optionType_ = new EquityOptionTypeEnum(optionTypeNode);
         }
     }
     
 
     XmlNode equityEffectiveDateNode = xmlNode.SelectSingleNode("equityEffectiveDate");
     
     if (equityEffectiveDateNode != null)
     {
         if (equityEffectiveDateNode.Attributes["href"] != null || equityEffectiveDateNode.Attributes["id"] != null) 
         {
             if (equityEffectiveDateNode.Attributes["id"] != null) 
             {
                 equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(equityEffectiveDateNode);
                 IDManager.SetID(equityEffectiveDateIDRef_, ob);
             }
             else if (equityEffectiveDateNode.Attributes["href"] != null)
             {
                 equityEffectiveDateIDRef_ = equityEffectiveDateNode.Attributes["href"].Value;
             }
             else
             {
                 equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode);
             }
         }
         else
         {
             equityEffectiveDate_ = new XsdTypeDate(equityEffectiveDateNode);
         }
     }
     
 
     XmlNode underlyerNode = xmlNode.SelectSingleNode("underlyer");
     
     if (underlyerNode != null)
     {
         if (underlyerNode.Attributes["href"] != null || underlyerNode.Attributes["id"] != null) 
         {
             if (underlyerNode.Attributes["id"] != null) 
             {
                 underlyerIDRef_ = underlyerNode.Attributes["id"].Value;
                 Underlyer ob = new Underlyer(underlyerNode);
                 IDManager.SetID(underlyerIDRef_, ob);
             }
             else if (underlyerNode.Attributes["href"] != null)
             {
                 underlyerIDRef_ = underlyerNode.Attributes["href"].Value;
             }
             else
             {
                 underlyer_ = new Underlyer(underlyerNode);
             }
         }
         else
         {
             underlyer_ = new Underlyer(underlyerNode);
         }
     }
     
 
     XmlNode notionalNode = xmlNode.SelectSingleNode("notional");
     
     if (notionalNode != null)
     {
         if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) 
         {
             if (notionalNode.Attributes["id"] != null) 
             {
                 notionalIDRef_ = notionalNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(notionalNode);
                 IDManager.SetID(notionalIDRef_, ob);
             }
             else if (notionalNode.Attributes["href"] != null)
             {
                 notionalIDRef_ = notionalNode.Attributes["href"].Value;
             }
             else
             {
                 notional_ = new NonNegativeMoney(notionalNode);
             }
         }
         else
         {
             notional_ = new NonNegativeMoney(notionalNode);
         }
     }
     
 
     XmlNode equityExerciseNode = xmlNode.SelectSingleNode("equityExercise");
     
     if (equityExerciseNode != null)
     {
         if (equityExerciseNode.Attributes["href"] != null || equityExerciseNode.Attributes["id"] != null) 
         {
             if (equityExerciseNode.Attributes["id"] != null) 
             {
                 equityExerciseIDRef_ = equityExerciseNode.Attributes["id"].Value;
                 EquityExerciseValuationSettlement ob = new EquityExerciseValuationSettlement(equityExerciseNode);
                 IDManager.SetID(equityExerciseIDRef_, ob);
             }
             else if (equityExerciseNode.Attributes["href"] != null)
             {
                 equityExerciseIDRef_ = equityExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
             }
         }
         else
         {
             equityExercise_ = new EquityExerciseValuationSettlement(equityExerciseNode);
         }
     }
     
 
     XmlNode featureNode = xmlNode.SelectSingleNode("feature");
     
     if (featureNode != null)
     {
         if (featureNode.Attributes["href"] != null || featureNode.Attributes["id"] != null) 
         {
             if (featureNode.Attributes["id"] != null) 
             {
                 featureIDRef_ = featureNode.Attributes["id"].Value;
                 OptionFeatures ob = new OptionFeatures(featureNode);
                 IDManager.SetID(featureIDRef_, ob);
             }
             else if (featureNode.Attributes["href"] != null)
             {
                 featureIDRef_ = featureNode.Attributes["href"].Value;
             }
             else
             {
                 feature_ = new OptionFeatures(featureNode);
             }
         }
         else
         {
             feature_ = new OptionFeatures(featureNode);
         }
     }
     
 
     XmlNode fxFeatureNode = xmlNode.SelectSingleNode("fxFeature");
     
     if (fxFeatureNode != null)
     {
         if (fxFeatureNode.Attributes["href"] != null || fxFeatureNode.Attributes["id"] != null) 
         {
             if (fxFeatureNode.Attributes["id"] != null) 
             {
                 fxFeatureIDRef_ = fxFeatureNode.Attributes["id"].Value;
                 FxFeature ob = new FxFeature(fxFeatureNode);
                 IDManager.SetID(fxFeatureIDRef_, ob);
             }
             else if (fxFeatureNode.Attributes["href"] != null)
             {
                 fxFeatureIDRef_ = fxFeatureNode.Attributes["href"].Value;
             }
             else
             {
                 fxFeature_ = new FxFeature(fxFeatureNode);
             }
         }
         else
         {
             fxFeature_ = new FxFeature(fxFeatureNode);
         }
     }
     
 
     XmlNode strategyFeatureNode = xmlNode.SelectSingleNode("strategyFeature");
     
     if (strategyFeatureNode != null)
     {
         if (strategyFeatureNode.Attributes["href"] != null || strategyFeatureNode.Attributes["id"] != null) 
         {
             if (strategyFeatureNode.Attributes["id"] != null) 
             {
                 strategyFeatureIDRef_ = strategyFeatureNode.Attributes["id"].Value;
                 StrategyFeature ob = new StrategyFeature(strategyFeatureNode);
                 IDManager.SetID(strategyFeatureIDRef_, ob);
             }
             else if (strategyFeatureNode.Attributes["href"] != null)
             {
                 strategyFeatureIDRef_ = strategyFeatureNode.Attributes["href"].Value;
             }
             else
             {
                 strategyFeature_ = new StrategyFeature(strategyFeatureNode);
             }
         }
         else
         {
             strategyFeature_ = new StrategyFeature(strategyFeatureNode);
         }
     }
     
 
 }
 public PrincipalExchangeAmount(XmlNode xmlNode)
 {
     XmlNode amountRelativeToNode = xmlNode.SelectSingleNode("amountRelativeTo");
     
     if (amountRelativeToNode != null)
     {
         if (amountRelativeToNode.Attributes["href"] != null || amountRelativeToNode.Attributes["id"] != null) 
         {
             if (amountRelativeToNode.Attributes["id"] != null) 
             {
                 amountRelativeToIDRef_ = amountRelativeToNode.Attributes["id"].Value;
                 AmountReference ob = new AmountReference(amountRelativeToNode);
                 IDManager.SetID(amountRelativeToIDRef_, ob);
             }
             else if (amountRelativeToNode.Attributes["href"] != null)
             {
                 amountRelativeToIDRef_ = amountRelativeToNode.Attributes["href"].Value;
             }
             else
             {
                 amountRelativeTo_ = new AmountReference(amountRelativeToNode);
             }
         }
         else
         {
             amountRelativeTo_ = new AmountReference(amountRelativeToNode);
         }
     }
     
 
     XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod");
     
     if (determinationMethodNode != null)
     {
         if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null) 
         {
             if (determinationMethodNode.Attributes["id"] != null) 
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value;
                 DeterminationMethod ob = new DeterminationMethod(determinationMethodNode);
                 IDManager.SetID(determinationMethodIDRef_, ob);
             }
             else if (determinationMethodNode.Attributes["href"] != null)
             {
                 determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value;
             }
             else
             {
                 determinationMethod_ = new DeterminationMethod(determinationMethodNode);
             }
         }
         else
         {
             determinationMethod_ = new DeterminationMethod(determinationMethodNode);
         }
     }
     
 
     XmlNode principalAmountNode = xmlNode.SelectSingleNode("principalAmount");
     
     if (principalAmountNode != null)
     {
         if (principalAmountNode.Attributes["href"] != null || principalAmountNode.Attributes["id"] != null) 
         {
             if (principalAmountNode.Attributes["id"] != null) 
             {
                 principalAmountIDRef_ = principalAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(principalAmountNode);
                 IDManager.SetID(principalAmountIDRef_, ob);
             }
             else if (principalAmountNode.Attributes["href"] != null)
             {
                 principalAmountIDRef_ = principalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 principalAmount_ = new NonNegativeMoney(principalAmountNode);
             }
         }
         else
         {
             principalAmount_ = new NonNegativeMoney(principalAmountNode);
         }
     }
     
 
 }
        public WeatherLegCalculation(XmlNode xmlNode)
        {
            XmlNode settlementLevelNode = xmlNode.SelectSingleNode("settlementLevel");

            if (settlementLevelNode != null)
            {
                if (settlementLevelNode.Attributes["href"] != null || settlementLevelNode.Attributes["id"] != null)
                {
                    if (settlementLevelNode.Attributes["id"] != null)
                    {
                        settlementLevelIDRef_ = settlementLevelNode.Attributes["id"].Value;
                        WeatherSettlementLevelEnum ob = new WeatherSettlementLevelEnum(settlementLevelNode);
                        IDManager.SetID(settlementLevelIDRef_, ob);
                    }
                    else if (settlementLevelNode.Attributes["href"] != null)
                    {
                        settlementLevelIDRef_ = settlementLevelNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementLevel_ = new WeatherSettlementLevelEnum(settlementLevelNode);
                    }
                }
                else
                {
                    settlementLevel_ = new WeatherSettlementLevelEnum(settlementLevelNode);
                }
            }


            XmlNode referenceLevelEqualsZeroNode = xmlNode.SelectSingleNode("referenceLevelEqualsZero");

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


            XmlNode calculationDateNode = xmlNode.SelectSingleNode("calculationDate");

            if (calculationDateNode != null)
            {
                if (calculationDateNode.Attributes["href"] != null || calculationDateNode.Attributes["id"] != null)
                {
                    if (calculationDateNode.Attributes["id"] != null)
                    {
                        calculationDateIDRef_ = calculationDateNode.Attributes["id"].Value;
                        Period ob = new Period(calculationDateNode);
                        IDManager.SetID(calculationDateIDRef_, ob);
                    }
                    else if (calculationDateNode.Attributes["href"] != null)
                    {
                        calculationDateIDRef_ = calculationDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationDate_ = new Period(calculationDateNode);
                    }
                }
                else
                {
                    calculationDate_ = new Period(calculationDateNode);
                }
            }


            XmlNode businessDaysNode = xmlNode.SelectSingleNode("businessDays");

            if (businessDaysNode != null)
            {
                if (businessDaysNode.Attributes["href"] != null || businessDaysNode.Attributes["id"] != null)
                {
                    if (businessDaysNode.Attributes["id"] != null)
                    {
                        businessDaysIDRef_ = businessDaysNode.Attributes["id"].Value;
                        BusinessCenter ob = new BusinessCenter(businessDaysNode);
                        IDManager.SetID(businessDaysIDRef_, ob);
                    }
                    else if (businessDaysNode.Attributes["href"] != null)
                    {
                        businessDaysIDRef_ = businessDaysNode.Attributes["href"].Value;
                    }
                    else
                    {
                        businessDays_ = new BusinessCenter(businessDaysNode);
                    }
                }
                else
                {
                    businessDays_ = new BusinessCenter(businessDaysNode);
                }
            }


            XmlNode dataCorrectionNode = xmlNode.SelectSingleNode("dataCorrection");

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


            XmlNode correctionPeriodNode = xmlNode.SelectSingleNode("correctionPeriod");

            if (correctionPeriodNode != null)
            {
                if (correctionPeriodNode.Attributes["href"] != null || correctionPeriodNode.Attributes["id"] != null)
                {
                    if (correctionPeriodNode.Attributes["id"] != null)
                    {
                        correctionPeriodIDRef_ = correctionPeriodNode.Attributes["id"].Value;
                        Period ob = new Period(correctionPeriodNode);
                        IDManager.SetID(correctionPeriodIDRef_, ob);
                    }
                    else if (correctionPeriodNode.Attributes["href"] != null)
                    {
                        correctionPeriodIDRef_ = correctionPeriodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        correctionPeriod_ = new Period(correctionPeriodNode);
                    }
                }
                else
                {
                    correctionPeriod_ = new Period(correctionPeriodNode);
                }
            }


            XmlNode maximumPaymentAmountNode = xmlNode.SelectSingleNode("maximumPaymentAmount");

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


            XmlNode maximumTransactionPaymentAmountNode = xmlNode.SelectSingleNode("maximumTransactionPaymentAmount");

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


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