public ReturnLegValuation(XmlNode xmlNode)
 {
     XmlNode initialPriceNode = xmlNode.SelectSingleNode("initialPrice");
     
     if (initialPriceNode != null)
     {
         if (initialPriceNode.Attributes["href"] != null || initialPriceNode.Attributes["id"] != null) 
         {
             if (initialPriceNode.Attributes["id"] != null) 
             {
                 initialPriceIDRef_ = initialPriceNode.Attributes["id"].Value;
                 ReturnLegValuationPrice ob = new ReturnLegValuationPrice(initialPriceNode);
                 IDManager.SetID(initialPriceIDRef_, ob);
             }
             else if (initialPriceNode.Attributes["href"] != null)
             {
                 initialPriceIDRef_ = initialPriceNode.Attributes["href"].Value;
             }
             else
             {
                 initialPrice_ = new ReturnLegValuationPrice(initialPriceNode);
             }
         }
         else
         {
             initialPrice_ = new ReturnLegValuationPrice(initialPriceNode);
         }
     }
     
 
     XmlNode notionalResetNode = xmlNode.SelectSingleNode("notionalReset");
     
     if (notionalResetNode != null)
     {
         if (notionalResetNode.Attributes["href"] != null || notionalResetNode.Attributes["id"] != null) 
         {
             if (notionalResetNode.Attributes["id"] != null) 
             {
                 notionalResetIDRef_ = notionalResetNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(notionalResetNode);
                 IDManager.SetID(notionalResetIDRef_, ob);
             }
             else if (notionalResetNode.Attributes["href"] != null)
             {
                 notionalResetIDRef_ = notionalResetNode.Attributes["href"].Value;
             }
             else
             {
                 notionalReset_ = new XsdTypeBoolean(notionalResetNode);
             }
         }
         else
         {
             notionalReset_ = new XsdTypeBoolean(notionalResetNode);
         }
     }
     
 
     XmlNode valuationPriceInterimNode = xmlNode.SelectSingleNode("valuationPriceInterim");
     
     if (valuationPriceInterimNode != null)
     {
         if (valuationPriceInterimNode.Attributes["href"] != null || valuationPriceInterimNode.Attributes["id"] != null) 
         {
             if (valuationPriceInterimNode.Attributes["id"] != null) 
             {
                 valuationPriceInterimIDRef_ = valuationPriceInterimNode.Attributes["id"].Value;
                 ReturnLegValuationPrice ob = new ReturnLegValuationPrice(valuationPriceInterimNode);
                 IDManager.SetID(valuationPriceInterimIDRef_, ob);
             }
             else if (valuationPriceInterimNode.Attributes["href"] != null)
             {
                 valuationPriceInterimIDRef_ = valuationPriceInterimNode.Attributes["href"].Value;
             }
             else
             {
                 valuationPriceInterim_ = new ReturnLegValuationPrice(valuationPriceInterimNode);
             }
         }
         else
         {
             valuationPriceInterim_ = new ReturnLegValuationPrice(valuationPriceInterimNode);
         }
     }
     
 
     XmlNode valuationPriceFinalNode = xmlNode.SelectSingleNode("valuationPriceFinal");
     
     if (valuationPriceFinalNode != null)
     {
         if (valuationPriceFinalNode.Attributes["href"] != null || valuationPriceFinalNode.Attributes["id"] != null) 
         {
             if (valuationPriceFinalNode.Attributes["id"] != null) 
             {
                 valuationPriceFinalIDRef_ = valuationPriceFinalNode.Attributes["id"].Value;
                 ReturnLegValuationPrice ob = new ReturnLegValuationPrice(valuationPriceFinalNode);
                 IDManager.SetID(valuationPriceFinalIDRef_, ob);
             }
             else if (valuationPriceFinalNode.Attributes["href"] != null)
             {
                 valuationPriceFinalIDRef_ = valuationPriceFinalNode.Attributes["href"].Value;
             }
             else
             {
                 valuationPriceFinal_ = new ReturnLegValuationPrice(valuationPriceFinalNode);
             }
         }
         else
         {
             valuationPriceFinal_ = new ReturnLegValuationPrice(valuationPriceFinalNode);
         }
     }
     
 
     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;
                 ReturnSwapPaymentDates ob = new ReturnSwapPaymentDates(paymentDatesNode);
                 IDManager.SetID(paymentDatesIDRef_, ob);
             }
             else if (paymentDatesNode.Attributes["href"] != null)
             {
                 paymentDatesIDRef_ = paymentDatesNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDates_ = new ReturnSwapPaymentDates(paymentDatesNode);
             }
         }
         else
         {
             paymentDates_ = new ReturnSwapPaymentDates(paymentDatesNode);
         }
     }
     
 
     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);
         }
     }
     
 
 }
 public ReturnLegValuation(XmlNode xmlNode)
 {
     XmlNodeList initialPriceNodeList = xmlNode.SelectNodes("initialPrice");
     if (initialPriceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in initialPriceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 initialPriceIDRef = item.Attributes["id"].Name;
                 ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                 IDManager.SetID(initialPriceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 initialPriceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 initialPrice = new ReturnLegValuationPrice(item);
             }
         }
     }
     
 
     XmlNodeList notionalResetNodeList = xmlNode.SelectNodes("notionalReset");
     if (notionalResetNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in notionalResetNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 notionalResetIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(notionalResetIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 notionalResetIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 notionalReset = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList valuationPriceInterimNodeList = xmlNode.SelectNodes("valuationPriceInterim");
     if (valuationPriceInterimNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in valuationPriceInterimNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 valuationPriceInterimIDRef = item.Attributes["id"].Name;
                 ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                 IDManager.SetID(valuationPriceInterimIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 valuationPriceInterimIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 valuationPriceInterim = new ReturnLegValuationPrice(item);
             }
         }
     }
     
 
     XmlNodeList valuationPriceFinalNodeList = xmlNode.SelectNodes("valuationPriceFinal");
     if (valuationPriceFinalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in valuationPriceFinalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 valuationPriceFinalIDRef = item.Attributes["id"].Name;
                 ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                 IDManager.SetID(valuationPriceFinalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 valuationPriceFinalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 valuationPriceFinal = new ReturnLegValuationPrice(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;
                 ReturnSwapPaymentDates ob = ReturnSwapPaymentDates();
                 IDManager.SetID(paymentDatesIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDatesIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 paymentDates = new ReturnSwapPaymentDates(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);
             }
         }
     }
     
 
 }
        public ReturnLegValuation(XmlNode xmlNode)
        {
            XmlNode initialPriceNode = xmlNode.SelectSingleNode("initialPrice");

            if (initialPriceNode != null)
            {
                if (initialPriceNode.Attributes["href"] != null || initialPriceNode.Attributes["id"] != null)
                {
                    if (initialPriceNode.Attributes["id"] != null)
                    {
                        initialPriceIDRef_ = initialPriceNode.Attributes["id"].Value;
                        ReturnLegValuationPrice ob = new ReturnLegValuationPrice(initialPriceNode);
                        IDManager.SetID(initialPriceIDRef_, ob);
                    }
                    else if (initialPriceNode.Attributes["href"] != null)
                    {
                        initialPriceIDRef_ = initialPriceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        initialPrice_ = new ReturnLegValuationPrice(initialPriceNode);
                    }
                }
                else
                {
                    initialPrice_ = new ReturnLegValuationPrice(initialPriceNode);
                }
            }


            XmlNode notionalResetNode = xmlNode.SelectSingleNode("notionalReset");

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


            XmlNode valuationPriceInterimNode = xmlNode.SelectSingleNode("valuationPriceInterim");

            if (valuationPriceInterimNode != null)
            {
                if (valuationPriceInterimNode.Attributes["href"] != null || valuationPriceInterimNode.Attributes["id"] != null)
                {
                    if (valuationPriceInterimNode.Attributes["id"] != null)
                    {
                        valuationPriceInterimIDRef_ = valuationPriceInterimNode.Attributes["id"].Value;
                        ReturnLegValuationPrice ob = new ReturnLegValuationPrice(valuationPriceInterimNode);
                        IDManager.SetID(valuationPriceInterimIDRef_, ob);
                    }
                    else if (valuationPriceInterimNode.Attributes["href"] != null)
                    {
                        valuationPriceInterimIDRef_ = valuationPriceInterimNode.Attributes["href"].Value;
                    }
                    else
                    {
                        valuationPriceInterim_ = new ReturnLegValuationPrice(valuationPriceInterimNode);
                    }
                }
                else
                {
                    valuationPriceInterim_ = new ReturnLegValuationPrice(valuationPriceInterimNode);
                }
            }


            XmlNode valuationPriceFinalNode = xmlNode.SelectSingleNode("valuationPriceFinal");

            if (valuationPriceFinalNode != null)
            {
                if (valuationPriceFinalNode.Attributes["href"] != null || valuationPriceFinalNode.Attributes["id"] != null)
                {
                    if (valuationPriceFinalNode.Attributes["id"] != null)
                    {
                        valuationPriceFinalIDRef_ = valuationPriceFinalNode.Attributes["id"].Value;
                        ReturnLegValuationPrice ob = new ReturnLegValuationPrice(valuationPriceFinalNode);
                        IDManager.SetID(valuationPriceFinalIDRef_, ob);
                    }
                    else if (valuationPriceFinalNode.Attributes["href"] != null)
                    {
                        valuationPriceFinalIDRef_ = valuationPriceFinalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        valuationPriceFinal_ = new ReturnLegValuationPrice(valuationPriceFinalNode);
                    }
                }
                else
                {
                    valuationPriceFinal_ = new ReturnLegValuationPrice(valuationPriceFinalNode);
                }
            }


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


            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);
                }
            }
        }
        public ReturnLegValuation(XmlNode xmlNode)
        {
            XmlNodeList initialPriceNodeList = xmlNode.SelectNodes("initialPrice");

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

            foreach (XmlNode item in initialPriceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        initialPriceIDRef = item.Attributes["id"].Name;
                        ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                        IDManager.SetID(initialPriceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        initialPriceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        initialPrice = new ReturnLegValuationPrice(item);
                    }
                }
            }


            XmlNodeList notionalResetNodeList = xmlNode.SelectNodes("notionalReset");

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

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


            XmlNodeList valuationPriceInterimNodeList = xmlNode.SelectNodes("valuationPriceInterim");

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

            foreach (XmlNode item in valuationPriceInterimNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationPriceInterimIDRef = item.Attributes["id"].Name;
                        ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                        IDManager.SetID(valuationPriceInterimIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationPriceInterimIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationPriceInterim = new ReturnLegValuationPrice(item);
                    }
                }
            }


            XmlNodeList valuationPriceFinalNodeList = xmlNode.SelectNodes("valuationPriceFinal");

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

            foreach (XmlNode item in valuationPriceFinalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationPriceFinalIDRef = item.Attributes["id"].Name;
                        ReturnLegValuationPrice ob = ReturnLegValuationPrice();
                        IDManager.SetID(valuationPriceFinalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationPriceFinalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationPriceFinal = new ReturnLegValuationPrice(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;
                        ReturnSwapPaymentDates ob = ReturnSwapPaymentDates();
                        IDManager.SetID(paymentDatesIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDatesIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDates = new ReturnSwapPaymentDates(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);
                    }
                }
            }
        }