public InstrumentSet(XmlNode xmlNode)
        {
            XmlNodeList underlyingAssetNodeList = xmlNode.SelectNodes("underlyingAsset");

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


            XmlNodeList curveInstrumentNodeList = xmlNode.SelectNodes("curveInstrument");

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

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


            XmlNodeList depositNodeList = xmlNode.SelectNodes("deposit");

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

            foreach (XmlNode item in depositNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        depositIDRef = item.Attributes["id"].Name;
                        Deposit ob = Deposit();
                        IDManager.SetID(depositIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        depositIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deposit = new Deposit(item);
                    }
                }
            }


            XmlNodeList fxNodeList = xmlNode.SelectNodes("fx");

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

            foreach (XmlNode item in fxNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        fxIDRef = item.Attributes["id"].Name;
                        FxRateAsset ob = FxRateAsset();
                        IDManager.SetID(fxIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        fxIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        fx = new FxRateAsset(item);
                    }
                }
            }


            XmlNodeList rateIndexNodeList = xmlNode.SelectNodes("rateIndex");

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

            foreach (XmlNode item in rateIndexNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        rateIndexIDRef = item.Attributes["id"].Name;
                        RateIndex ob = RateIndex();
                        IDManager.SetID(rateIndexIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        rateIndexIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        rateIndex = new RateIndex(item);
                    }
                }
            }


            XmlNodeList simpleCreditDefaultSwapNodeList = xmlNode.SelectNodes("simpleCreditDefaultSwap");

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

            foreach (XmlNode item in simpleCreditDefaultSwapNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        simpleCreditDefaultSwapIDRef = item.Attributes["id"].Name;
                        SimpleCreditDefaultSwap ob = SimpleCreditDefaultSwap();
                        IDManager.SetID(simpleCreditDefaultSwapIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        simpleCreditDefaultSwapIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        simpleCreditDefaultSwap = new SimpleCreditDefaultSwap(item);
                    }
                }
            }


            XmlNodeList simpleFraNodeList = xmlNode.SelectNodes("simpleFra");

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

            foreach (XmlNode item in simpleFraNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        simpleFraIDRef = item.Attributes["id"].Name;
                        SimpleFra ob = SimpleFra();
                        IDManager.SetID(simpleFraIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        simpleFraIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        simpleFra = new SimpleFra(item);
                    }
                }
            }


            XmlNodeList simpleIrSwapNodeList = xmlNode.SelectNodes("simpleIrSwap");

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

            foreach (XmlNode item in simpleIrSwapNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        simpleIrSwapIDRef = item.Attributes["id"].Name;
                        SimpleIRSwap ob = SimpleIRSwap();
                        IDManager.SetID(simpleIrSwapIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        simpleIrSwapIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        simpleIrSwap = new SimpleIRSwap(item);
                    }
                }
            }
        }
 public InstrumentSet(XmlNode xmlNode)
 {
     XmlNodeList underlyingAssetNodeList = xmlNode.SelectNodes("underlyingAsset");
     if (underlyingAssetNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in underlyingAssetNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 underlyingAssetIDRef = item.Attributes["id"].Name;
                 Asset ob = Asset();
                 IDManager.SetID(underlyingAssetIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 underlyingAssetIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 underlyingAsset = new Asset(item);
             }
         }
     }
     
 
     XmlNodeList basketNodeList = xmlNode.SelectNodes("basket");
     if (basketNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in basketNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 basketIDRef = item.Attributes["id"].Name;
                 Basket ob = Basket();
                 IDManager.SetID(basketIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 basketIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 basket = new Basket(item);
             }
         }
     }
     
 
     XmlNodeList bondNodeList = xmlNode.SelectNodes("bond");
     if (bondNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in bondNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 bondIDRef = item.Attributes["id"].Name;
                 Bond ob = Bond();
                 IDManager.SetID(bondIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 bondIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 bond = new Bond(item);
             }
         }
     }
     
 
     XmlNodeList cashNodeList = xmlNode.SelectNodes("cash");
     if (cashNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in cashNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 cashIDRef = item.Attributes["id"].Name;
                 Cash ob = Cash();
                 IDManager.SetID(cashIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 cashIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 cash = new Cash(item);
             }
         }
     }
     
 
     XmlNodeList commodityNodeList = xmlNode.SelectNodes("commodity");
     if (commodityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in commodityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 commodityIDRef = item.Attributes["id"].Name;
                 Commodity ob = Commodity();
                 IDManager.SetID(commodityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 commodityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 commodity = new Commodity(item);
             }
         }
     }
     
 
     XmlNodeList convertibleBondNodeList = xmlNode.SelectNodes("convertibleBond");
     if (convertibleBondNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in convertibleBondNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 convertibleBondIDRef = item.Attributes["id"].Name;
                 ConvertibleBond ob = ConvertibleBond();
                 IDManager.SetID(convertibleBondIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 convertibleBondIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 convertibleBond = new ConvertibleBond(item);
             }
         }
     }
     
 
     XmlNodeList equityNodeList = xmlNode.SelectNodes("equity");
     if (equityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in equityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 equityIDRef = item.Attributes["id"].Name;
                 EquityAsset ob = EquityAsset();
                 IDManager.SetID(equityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 equityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 equity = new EquityAsset(item);
             }
         }
     }
     
 
     XmlNodeList exchangeTradedFundNodeList = xmlNode.SelectNodes("exchangeTradedFund");
     if (exchangeTradedFundNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeTradedFundNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeTradedFundIDRef = item.Attributes["id"].Name;
                 ExchangeTradedFund ob = ExchangeTradedFund();
                 IDManager.SetID(exchangeTradedFundIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeTradedFundIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeTradedFund = new ExchangeTradedFund(item);
             }
         }
     }
     
 
     XmlNodeList futureNodeList = xmlNode.SelectNodes("future");
     if (futureNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in futureNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 futureIDRef = item.Attributes["id"].Name;
                 Future ob = Future();
                 IDManager.SetID(futureIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 futureIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 future = new Future(item);
             }
         }
     }
     
 
     XmlNodeList indexNodeList = xmlNode.SelectNodes("index");
     if (indexNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in indexNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 indexIDRef = item.Attributes["id"].Name;
                 Index ob = Index();
                 IDManager.SetID(indexIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 indexIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 index = new Index(item);
             }
         }
     }
     
 
     XmlNodeList loanNodeList = xmlNode.SelectNodes("loan");
     if (loanNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in loanNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 loanIDRef = item.Attributes["id"].Name;
                 Loan ob = Loan();
                 IDManager.SetID(loanIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 loanIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 loan = new Loan(item);
             }
         }
     }
     
 
     XmlNodeList mortgageNodeList = xmlNode.SelectNodes("mortgage");
     if (mortgageNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in mortgageNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 mortgageIDRef = item.Attributes["id"].Name;
                 Mortgage ob = Mortgage();
                 IDManager.SetID(mortgageIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 mortgageIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 mortgage = new Mortgage(item);
             }
         }
     }
     
 
     XmlNodeList mutualFundNodeList = xmlNode.SelectNodes("mutualFund");
     if (mutualFundNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in mutualFundNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 mutualFundIDRef = item.Attributes["id"].Name;
                 MutualFund ob = MutualFund();
                 IDManager.SetID(mutualFundIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 mutualFundIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 mutualFund = new MutualFund(item);
             }
         }
     }
     
 
     XmlNodeList curveInstrumentNodeList = xmlNode.SelectNodes("curveInstrument");
     if (curveInstrumentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in curveInstrumentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 curveInstrumentIDRef = item.Attributes["id"].Name;
                 Asset ob = Asset();
                 IDManager.SetID(curveInstrumentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 curveInstrumentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 curveInstrument = new Asset(item);
             }
         }
     }
     
 
     XmlNodeList depositNodeList = xmlNode.SelectNodes("deposit");
     if (depositNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in depositNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 depositIDRef = item.Attributes["id"].Name;
                 Deposit ob = Deposit();
                 IDManager.SetID(depositIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 depositIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deposit = new Deposit(item);
             }
         }
     }
     
 
     XmlNodeList fxNodeList = xmlNode.SelectNodes("fx");
     if (fxNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in fxNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 fxIDRef = item.Attributes["id"].Name;
                 FxRateAsset ob = FxRateAsset();
                 IDManager.SetID(fxIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 fxIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 fx = new FxRateAsset(item);
             }
         }
     }
     
 
     XmlNodeList rateIndexNodeList = xmlNode.SelectNodes("rateIndex");
     if (rateIndexNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in rateIndexNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 rateIndexIDRef = item.Attributes["id"].Name;
                 RateIndex ob = RateIndex();
                 IDManager.SetID(rateIndexIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 rateIndexIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 rateIndex = new RateIndex(item);
             }
         }
     }
     
 
     XmlNodeList simpleCreditDefaultSwapNodeList = xmlNode.SelectNodes("simpleCreditDefaultSwap");
     if (simpleCreditDefaultSwapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in simpleCreditDefaultSwapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 simpleCreditDefaultSwapIDRef = item.Attributes["id"].Name;
                 SimpleCreditDefaultSwap ob = SimpleCreditDefaultSwap();
                 IDManager.SetID(simpleCreditDefaultSwapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 simpleCreditDefaultSwapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 simpleCreditDefaultSwap = new SimpleCreditDefaultSwap(item);
             }
         }
     }
     
 
     XmlNodeList simpleFraNodeList = xmlNode.SelectNodes("simpleFra");
     if (simpleFraNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in simpleFraNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 simpleFraIDRef = item.Attributes["id"].Name;
                 SimpleFra ob = SimpleFra();
                 IDManager.SetID(simpleFraIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 simpleFraIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 simpleFra = new SimpleFra(item);
             }
         }
     }
     
 
     XmlNodeList simpleIrSwapNodeList = xmlNode.SelectNodes("simpleIrSwap");
     if (simpleIrSwapNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in simpleIrSwapNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 simpleIrSwapIDRef = item.Attributes["id"].Name;
                 SimpleIRSwap ob = SimpleIRSwap();
                 IDManager.SetID(simpleIrSwapIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 simpleIrSwapIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 simpleIrSwap = new SimpleIRSwap(item);
             }
         }
     }
     
 
 }
        public InstrumentSet(XmlNode xmlNode)
        {
            XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset");

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


            XmlNode curveInstrumentNode = xmlNode.SelectSingleNode("curveInstrument");

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


            XmlNode depositNode = xmlNode.SelectSingleNode("deposit");

            if (depositNode != null)
            {
                if (depositNode.Attributes["href"] != null || depositNode.Attributes["id"] != null)
                {
                    if (depositNode.Attributes["id"] != null)
                    {
                        depositIDRef_ = depositNode.Attributes["id"].Value;
                        Deposit ob = new Deposit(depositNode);
                        IDManager.SetID(depositIDRef_, ob);
                    }
                    else if (depositNode.Attributes["href"] != null)
                    {
                        depositIDRef_ = depositNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deposit_ = new Deposit(depositNode);
                    }
                }
                else
                {
                    deposit_ = new Deposit(depositNode);
                }
            }


            XmlNode fxNode = xmlNode.SelectSingleNode("fx");

            if (fxNode != null)
            {
                if (fxNode.Attributes["href"] != null || fxNode.Attributes["id"] != null)
                {
                    if (fxNode.Attributes["id"] != null)
                    {
                        fxIDRef_ = fxNode.Attributes["id"].Value;
                        FxRateAsset ob = new FxRateAsset(fxNode);
                        IDManager.SetID(fxIDRef_, ob);
                    }
                    else if (fxNode.Attributes["href"] != null)
                    {
                        fxIDRef_ = fxNode.Attributes["href"].Value;
                    }
                    else
                    {
                        fx_ = new FxRateAsset(fxNode);
                    }
                }
                else
                {
                    fx_ = new FxRateAsset(fxNode);
                }
            }


            XmlNode rateIndexNode = xmlNode.SelectSingleNode("rateIndex");

            if (rateIndexNode != null)
            {
                if (rateIndexNode.Attributes["href"] != null || rateIndexNode.Attributes["id"] != null)
                {
                    if (rateIndexNode.Attributes["id"] != null)
                    {
                        rateIndexIDRef_ = rateIndexNode.Attributes["id"].Value;
                        RateIndex ob = new RateIndex(rateIndexNode);
                        IDManager.SetID(rateIndexIDRef_, ob);
                    }
                    else if (rateIndexNode.Attributes["href"] != null)
                    {
                        rateIndexIDRef_ = rateIndexNode.Attributes["href"].Value;
                    }
                    else
                    {
                        rateIndex_ = new RateIndex(rateIndexNode);
                    }
                }
                else
                {
                    rateIndex_ = new RateIndex(rateIndexNode);
                }
            }


            XmlNode simpleCreditDefaultSwapNode = xmlNode.SelectSingleNode("simpleCreditDefaultSwap");

            if (simpleCreditDefaultSwapNode != null)
            {
                if (simpleCreditDefaultSwapNode.Attributes["href"] != null || simpleCreditDefaultSwapNode.Attributes["id"] != null)
                {
                    if (simpleCreditDefaultSwapNode.Attributes["id"] != null)
                    {
                        simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["id"].Value;
                        SimpleCreditDefaultSwap ob = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
                        IDManager.SetID(simpleCreditDefaultSwapIDRef_, ob);
                    }
                    else if (simpleCreditDefaultSwapNode.Attributes["href"] != null)
                    {
                        simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["href"].Value;
                    }
                    else
                    {
                        simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
                    }
                }
                else
                {
                    simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
                }
            }


            XmlNode simpleFraNode = xmlNode.SelectSingleNode("simpleFra");

            if (simpleFraNode != null)
            {
                if (simpleFraNode.Attributes["href"] != null || simpleFraNode.Attributes["id"] != null)
                {
                    if (simpleFraNode.Attributes["id"] != null)
                    {
                        simpleFraIDRef_ = simpleFraNode.Attributes["id"].Value;
                        SimpleFra ob = new SimpleFra(simpleFraNode);
                        IDManager.SetID(simpleFraIDRef_, ob);
                    }
                    else if (simpleFraNode.Attributes["href"] != null)
                    {
                        simpleFraIDRef_ = simpleFraNode.Attributes["href"].Value;
                    }
                    else
                    {
                        simpleFra_ = new SimpleFra(simpleFraNode);
                    }
                }
                else
                {
                    simpleFra_ = new SimpleFra(simpleFraNode);
                }
            }


            XmlNode simpleIrSwapNode = xmlNode.SelectSingleNode("simpleIrSwap");

            if (simpleIrSwapNode != null)
            {
                if (simpleIrSwapNode.Attributes["href"] != null || simpleIrSwapNode.Attributes["id"] != null)
                {
                    if (simpleIrSwapNode.Attributes["id"] != null)
                    {
                        simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["id"].Value;
                        SimpleIRSwap ob = new SimpleIRSwap(simpleIrSwapNode);
                        IDManager.SetID(simpleIrSwapIDRef_, ob);
                    }
                    else if (simpleIrSwapNode.Attributes["href"] != null)
                    {
                        simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["href"].Value;
                    }
                    else
                    {
                        simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode);
                    }
                }
                else
                {
                    simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode);
                }
            }
        }
 public InstrumentSet(XmlNode xmlNode)
 {
     XmlNode underlyingAssetNode = xmlNode.SelectSingleNode("underlyingAsset");
     
     if (underlyingAssetNode != null)
     {
         if (underlyingAssetNode.Attributes["href"] != null || underlyingAssetNode.Attributes["id"] != null) 
         {
             if (underlyingAssetNode.Attributes["id"] != null) 
             {
                 underlyingAssetIDRef_ = underlyingAssetNode.Attributes["id"].Value;
                 Asset ob = new Asset(underlyingAssetNode);
                 IDManager.SetID(underlyingAssetIDRef_, ob);
             }
             else if (underlyingAssetNode.Attributes["href"] != null)
             {
                 underlyingAssetIDRef_ = underlyingAssetNode.Attributes["href"].Value;
             }
             else
             {
                 underlyingAsset_ = new Asset(underlyingAssetNode);
             }
         }
         else
         {
             underlyingAsset_ = new Asset(underlyingAssetNode);
         }
     }
     
 
     XmlNode basketNode = xmlNode.SelectSingleNode("basket");
     
     if (basketNode != null)
     {
         if (basketNode.Attributes["href"] != null || basketNode.Attributes["id"] != null) 
         {
             if (basketNode.Attributes["id"] != null) 
             {
                 basketIDRef_ = basketNode.Attributes["id"].Value;
                 Basket ob = new Basket(basketNode);
                 IDManager.SetID(basketIDRef_, ob);
             }
             else if (basketNode.Attributes["href"] != null)
             {
                 basketIDRef_ = basketNode.Attributes["href"].Value;
             }
             else
             {
                 basket_ = new Basket(basketNode);
             }
         }
         else
         {
             basket_ = new Basket(basketNode);
         }
     }
     
 
     XmlNode bondNode = xmlNode.SelectSingleNode("bond");
     
     if (bondNode != null)
     {
         if (bondNode.Attributes["href"] != null || bondNode.Attributes["id"] != null) 
         {
             if (bondNode.Attributes["id"] != null) 
             {
                 bondIDRef_ = bondNode.Attributes["id"].Value;
                 Bond ob = new Bond(bondNode);
                 IDManager.SetID(bondIDRef_, ob);
             }
             else if (bondNode.Attributes["href"] != null)
             {
                 bondIDRef_ = bondNode.Attributes["href"].Value;
             }
             else
             {
                 bond_ = new Bond(bondNode);
             }
         }
         else
         {
             bond_ = new Bond(bondNode);
         }
     }
     
 
     XmlNode cashNode = xmlNode.SelectSingleNode("cash");
     
     if (cashNode != null)
     {
         if (cashNode.Attributes["href"] != null || cashNode.Attributes["id"] != null) 
         {
             if (cashNode.Attributes["id"] != null) 
             {
                 cashIDRef_ = cashNode.Attributes["id"].Value;
                 Cash ob = new Cash(cashNode);
                 IDManager.SetID(cashIDRef_, ob);
             }
             else if (cashNode.Attributes["href"] != null)
             {
                 cashIDRef_ = cashNode.Attributes["href"].Value;
             }
             else
             {
                 cash_ = new Cash(cashNode);
             }
         }
         else
         {
             cash_ = new Cash(cashNode);
         }
     }
     
 
     XmlNode commodityNode = xmlNode.SelectSingleNode("commodity");
     
     if (commodityNode != null)
     {
         if (commodityNode.Attributes["href"] != null || commodityNode.Attributes["id"] != null) 
         {
             if (commodityNode.Attributes["id"] != null) 
             {
                 commodityIDRef_ = commodityNode.Attributes["id"].Value;
                 Commodity ob = new Commodity(commodityNode);
                 IDManager.SetID(commodityIDRef_, ob);
             }
             else if (commodityNode.Attributes["href"] != null)
             {
                 commodityIDRef_ = commodityNode.Attributes["href"].Value;
             }
             else
             {
                 commodity_ = new Commodity(commodityNode);
             }
         }
         else
         {
             commodity_ = new Commodity(commodityNode);
         }
     }
     
 
     XmlNode convertibleBondNode = xmlNode.SelectSingleNode("convertibleBond");
     
     if (convertibleBondNode != null)
     {
         if (convertibleBondNode.Attributes["href"] != null || convertibleBondNode.Attributes["id"] != null) 
         {
             if (convertibleBondNode.Attributes["id"] != null) 
             {
                 convertibleBondIDRef_ = convertibleBondNode.Attributes["id"].Value;
                 ConvertibleBond ob = new ConvertibleBond(convertibleBondNode);
                 IDManager.SetID(convertibleBondIDRef_, ob);
             }
             else if (convertibleBondNode.Attributes["href"] != null)
             {
                 convertibleBondIDRef_ = convertibleBondNode.Attributes["href"].Value;
             }
             else
             {
                 convertibleBond_ = new ConvertibleBond(convertibleBondNode);
             }
         }
         else
         {
             convertibleBond_ = new ConvertibleBond(convertibleBondNode);
         }
     }
     
 
     XmlNode equityNode = xmlNode.SelectSingleNode("equity");
     
     if (equityNode != null)
     {
         if (equityNode.Attributes["href"] != null || equityNode.Attributes["id"] != null) 
         {
             if (equityNode.Attributes["id"] != null) 
             {
                 equityIDRef_ = equityNode.Attributes["id"].Value;
                 EquityAsset ob = new EquityAsset(equityNode);
                 IDManager.SetID(equityIDRef_, ob);
             }
             else if (equityNode.Attributes["href"] != null)
             {
                 equityIDRef_ = equityNode.Attributes["href"].Value;
             }
             else
             {
                 equity_ = new EquityAsset(equityNode);
             }
         }
         else
         {
             equity_ = new EquityAsset(equityNode);
         }
     }
     
 
     XmlNode exchangeTradedFundNode = xmlNode.SelectSingleNode("exchangeTradedFund");
     
     if (exchangeTradedFundNode != null)
     {
         if (exchangeTradedFundNode.Attributes["href"] != null || exchangeTradedFundNode.Attributes["id"] != null) 
         {
             if (exchangeTradedFundNode.Attributes["id"] != null) 
             {
                 exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["id"].Value;
                 ExchangeTradedFund ob = new ExchangeTradedFund(exchangeTradedFundNode);
                 IDManager.SetID(exchangeTradedFundIDRef_, ob);
             }
             else if (exchangeTradedFundNode.Attributes["href"] != null)
             {
                 exchangeTradedFundIDRef_ = exchangeTradedFundNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
             }
         }
         else
         {
             exchangeTradedFund_ = new ExchangeTradedFund(exchangeTradedFundNode);
         }
     }
     
 
     XmlNode futureNode = xmlNode.SelectSingleNode("future");
     
     if (futureNode != null)
     {
         if (futureNode.Attributes["href"] != null || futureNode.Attributes["id"] != null) 
         {
             if (futureNode.Attributes["id"] != null) 
             {
                 futureIDRef_ = futureNode.Attributes["id"].Value;
                 Future ob = new Future(futureNode);
                 IDManager.SetID(futureIDRef_, ob);
             }
             else if (futureNode.Attributes["href"] != null)
             {
                 futureIDRef_ = futureNode.Attributes["href"].Value;
             }
             else
             {
                 future_ = new Future(futureNode);
             }
         }
         else
         {
             future_ = new Future(futureNode);
         }
     }
     
 
     XmlNode indexNode = xmlNode.SelectSingleNode("index");
     
     if (indexNode != null)
     {
         if (indexNode.Attributes["href"] != null || indexNode.Attributes["id"] != null) 
         {
             if (indexNode.Attributes["id"] != null) 
             {
                 indexIDRef_ = indexNode.Attributes["id"].Value;
                 Index ob = new Index(indexNode);
                 IDManager.SetID(indexIDRef_, ob);
             }
             else if (indexNode.Attributes["href"] != null)
             {
                 indexIDRef_ = indexNode.Attributes["href"].Value;
             }
             else
             {
                 index_ = new Index(indexNode);
             }
         }
         else
         {
             index_ = new Index(indexNode);
         }
     }
     
 
     XmlNode loanNode = xmlNode.SelectSingleNode("loan");
     
     if (loanNode != null)
     {
         if (loanNode.Attributes["href"] != null || loanNode.Attributes["id"] != null) 
         {
             if (loanNode.Attributes["id"] != null) 
             {
                 loanIDRef_ = loanNode.Attributes["id"].Value;
                 Loan ob = new Loan(loanNode);
                 IDManager.SetID(loanIDRef_, ob);
             }
             else if (loanNode.Attributes["href"] != null)
             {
                 loanIDRef_ = loanNode.Attributes["href"].Value;
             }
             else
             {
                 loan_ = new Loan(loanNode);
             }
         }
         else
         {
             loan_ = new Loan(loanNode);
         }
     }
     
 
     XmlNode mortgageNode = xmlNode.SelectSingleNode("mortgage");
     
     if (mortgageNode != null)
     {
         if (mortgageNode.Attributes["href"] != null || mortgageNode.Attributes["id"] != null) 
         {
             if (mortgageNode.Attributes["id"] != null) 
             {
                 mortgageIDRef_ = mortgageNode.Attributes["id"].Value;
                 Mortgage ob = new Mortgage(mortgageNode);
                 IDManager.SetID(mortgageIDRef_, ob);
             }
             else if (mortgageNode.Attributes["href"] != null)
             {
                 mortgageIDRef_ = mortgageNode.Attributes["href"].Value;
             }
             else
             {
                 mortgage_ = new Mortgage(mortgageNode);
             }
         }
         else
         {
             mortgage_ = new Mortgage(mortgageNode);
         }
     }
     
 
     XmlNode mutualFundNode = xmlNode.SelectSingleNode("mutualFund");
     
     if (mutualFundNode != null)
     {
         if (mutualFundNode.Attributes["href"] != null || mutualFundNode.Attributes["id"] != null) 
         {
             if (mutualFundNode.Attributes["id"] != null) 
             {
                 mutualFundIDRef_ = mutualFundNode.Attributes["id"].Value;
                 MutualFund ob = new MutualFund(mutualFundNode);
                 IDManager.SetID(mutualFundIDRef_, ob);
             }
             else if (mutualFundNode.Attributes["href"] != null)
             {
                 mutualFundIDRef_ = mutualFundNode.Attributes["href"].Value;
             }
             else
             {
                 mutualFund_ = new MutualFund(mutualFundNode);
             }
         }
         else
         {
             mutualFund_ = new MutualFund(mutualFundNode);
         }
     }
     
 
     XmlNode curveInstrumentNode = xmlNode.SelectSingleNode("curveInstrument");
     
     if (curveInstrumentNode != null)
     {
         if (curveInstrumentNode.Attributes["href"] != null || curveInstrumentNode.Attributes["id"] != null) 
         {
             if (curveInstrumentNode.Attributes["id"] != null) 
             {
                 curveInstrumentIDRef_ = curveInstrumentNode.Attributes["id"].Value;
                 Asset ob = new Asset(curveInstrumentNode);
                 IDManager.SetID(curveInstrumentIDRef_, ob);
             }
             else if (curveInstrumentNode.Attributes["href"] != null)
             {
                 curveInstrumentIDRef_ = curveInstrumentNode.Attributes["href"].Value;
             }
             else
             {
                 curveInstrument_ = new Asset(curveInstrumentNode);
             }
         }
         else
         {
             curveInstrument_ = new Asset(curveInstrumentNode);
         }
     }
     
 
     XmlNode depositNode = xmlNode.SelectSingleNode("deposit");
     
     if (depositNode != null)
     {
         if (depositNode.Attributes["href"] != null || depositNode.Attributes["id"] != null) 
         {
             if (depositNode.Attributes["id"] != null) 
             {
                 depositIDRef_ = depositNode.Attributes["id"].Value;
                 Deposit ob = new Deposit(depositNode);
                 IDManager.SetID(depositIDRef_, ob);
             }
             else if (depositNode.Attributes["href"] != null)
             {
                 depositIDRef_ = depositNode.Attributes["href"].Value;
             }
             else
             {
                 deposit_ = new Deposit(depositNode);
             }
         }
         else
         {
             deposit_ = new Deposit(depositNode);
         }
     }
     
 
     XmlNode fxNode = xmlNode.SelectSingleNode("fx");
     
     if (fxNode != null)
     {
         if (fxNode.Attributes["href"] != null || fxNode.Attributes["id"] != null) 
         {
             if (fxNode.Attributes["id"] != null) 
             {
                 fxIDRef_ = fxNode.Attributes["id"].Value;
                 FxRateAsset ob = new FxRateAsset(fxNode);
                 IDManager.SetID(fxIDRef_, ob);
             }
             else if (fxNode.Attributes["href"] != null)
             {
                 fxIDRef_ = fxNode.Attributes["href"].Value;
             }
             else
             {
                 fx_ = new FxRateAsset(fxNode);
             }
         }
         else
         {
             fx_ = new FxRateAsset(fxNode);
         }
     }
     
 
     XmlNode rateIndexNode = xmlNode.SelectSingleNode("rateIndex");
     
     if (rateIndexNode != null)
     {
         if (rateIndexNode.Attributes["href"] != null || rateIndexNode.Attributes["id"] != null) 
         {
             if (rateIndexNode.Attributes["id"] != null) 
             {
                 rateIndexIDRef_ = rateIndexNode.Attributes["id"].Value;
                 RateIndex ob = new RateIndex(rateIndexNode);
                 IDManager.SetID(rateIndexIDRef_, ob);
             }
             else if (rateIndexNode.Attributes["href"] != null)
             {
                 rateIndexIDRef_ = rateIndexNode.Attributes["href"].Value;
             }
             else
             {
                 rateIndex_ = new RateIndex(rateIndexNode);
             }
         }
         else
         {
             rateIndex_ = new RateIndex(rateIndexNode);
         }
     }
     
 
     XmlNode simpleCreditDefaultSwapNode = xmlNode.SelectSingleNode("simpleCreditDefaultSwap");
     
     if (simpleCreditDefaultSwapNode != null)
     {
         if (simpleCreditDefaultSwapNode.Attributes["href"] != null || simpleCreditDefaultSwapNode.Attributes["id"] != null) 
         {
             if (simpleCreditDefaultSwapNode.Attributes["id"] != null) 
             {
                 simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["id"].Value;
                 SimpleCreditDefaultSwap ob = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
                 IDManager.SetID(simpleCreditDefaultSwapIDRef_, ob);
             }
             else if (simpleCreditDefaultSwapNode.Attributes["href"] != null)
             {
                 simpleCreditDefaultSwapIDRef_ = simpleCreditDefaultSwapNode.Attributes["href"].Value;
             }
             else
             {
                 simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
             }
         }
         else
         {
             simpleCreditDefaultSwap_ = new SimpleCreditDefaultSwap(simpleCreditDefaultSwapNode);
         }
     }
     
 
     XmlNode simpleFraNode = xmlNode.SelectSingleNode("simpleFra");
     
     if (simpleFraNode != null)
     {
         if (simpleFraNode.Attributes["href"] != null || simpleFraNode.Attributes["id"] != null) 
         {
             if (simpleFraNode.Attributes["id"] != null) 
             {
                 simpleFraIDRef_ = simpleFraNode.Attributes["id"].Value;
                 SimpleFra ob = new SimpleFra(simpleFraNode);
                 IDManager.SetID(simpleFraIDRef_, ob);
             }
             else if (simpleFraNode.Attributes["href"] != null)
             {
                 simpleFraIDRef_ = simpleFraNode.Attributes["href"].Value;
             }
             else
             {
                 simpleFra_ = new SimpleFra(simpleFraNode);
             }
         }
         else
         {
             simpleFra_ = new SimpleFra(simpleFraNode);
         }
     }
     
 
     XmlNode simpleIrSwapNode = xmlNode.SelectSingleNode("simpleIrSwap");
     
     if (simpleIrSwapNode != null)
     {
         if (simpleIrSwapNode.Attributes["href"] != null || simpleIrSwapNode.Attributes["id"] != null) 
         {
             if (simpleIrSwapNode.Attributes["id"] != null) 
             {
                 simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["id"].Value;
                 SimpleIRSwap ob = new SimpleIRSwap(simpleIrSwapNode);
                 IDManager.SetID(simpleIrSwapIDRef_, ob);
             }
             else if (simpleIrSwapNode.Attributes["href"] != null)
             {
                 simpleIrSwapIDRef_ = simpleIrSwapNode.Attributes["href"].Value;
             }
             else
             {
                 simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode);
             }
         }
         else
         {
             simpleIrSwap_ = new SimpleIRSwap(simpleIrSwapNode);
         }
     }
     
 
 }