public UnderlyingAsset(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

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


            XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId");

            if (exchangeIdNode != null)
            {
                if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null)
                {
                    if (exchangeIdNode.Attributes["id"] != null)
                    {
                        exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value;
                        ExchangeId ob = new ExchangeId(exchangeIdNode);
                        IDManager.SetID(exchangeIdIDRef_, ob);
                    }
                    else if (exchangeIdNode.Attributes["href"] != null)
                    {
                        exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exchangeId_ = new ExchangeId(exchangeIdNode);
                    }
                }
                else
                {
                    exchangeId_ = new ExchangeId(exchangeIdNode);
                }
            }


            XmlNode clearanceSystemNode = xmlNode.SelectSingleNode("clearanceSystem");

            if (clearanceSystemNode != null)
            {
                if (clearanceSystemNode.Attributes["href"] != null || clearanceSystemNode.Attributes["id"] != null)
                {
                    if (clearanceSystemNode.Attributes["id"] != null)
                    {
                        clearanceSystemIDRef_ = clearanceSystemNode.Attributes["id"].Value;
                        ClearanceSystem ob = new ClearanceSystem(clearanceSystemNode);
                        IDManager.SetID(clearanceSystemIDRef_, ob);
                    }
                    else if (clearanceSystemNode.Attributes["href"] != null)
                    {
                        clearanceSystemIDRef_ = clearanceSystemNode.Attributes["href"].Value;
                    }
                    else
                    {
                        clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
                    }
                }
                else
                {
                    clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
                }
            }


            XmlNode definitionNode = xmlNode.SelectSingleNode("definition");

            if (definitionNode != null)
            {
                if (definitionNode.Attributes["href"] != null || definitionNode.Attributes["id"] != null)
                {
                    if (definitionNode.Attributes["id"] != null)
                    {
                        definitionIDRef_ = definitionNode.Attributes["id"].Value;
                        ProductReference ob = new ProductReference(definitionNode);
                        IDManager.SetID(definitionIDRef_, ob);
                    }
                    else if (definitionNode.Attributes["href"] != null)
                    {
                        definitionIDRef_ = definitionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        definition_ = new ProductReference(definitionNode);
                    }
                }
                else
                {
                    definition_ = new ProductReference(definitionNode);
                }
            }
        }
 public UnderlyingAsset(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");
     if (currencyNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in currencyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 currencyIDRef = item.Attributes["id"].Name;
                 IdentifiedCurrency ob = IdentifiedCurrency();
                 IDManager.SetID(currencyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 currencyIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 currency = new IdentifiedCurrency(item);
             }
         }
     }
     
 
     XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId");
     if (exchangeIdNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in exchangeIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 exchangeIdIDRef = item.Attributes["id"].Name;
                 ExchangeId ob = ExchangeId();
                 IDManager.SetID(exchangeIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 exchangeIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 exchangeId = new ExchangeId(item);
             }
         }
     }
     
 
     XmlNodeList clearanceSystemNodeList = xmlNode.SelectNodes("clearanceSystem");
     if (clearanceSystemNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in clearanceSystemNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 clearanceSystemIDRef = item.Attributes["id"].Name;
                 ClearanceSystem ob = ClearanceSystem();
                 IDManager.SetID(clearanceSystemIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 clearanceSystemIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 clearanceSystem = new ClearanceSystem(item);
             }
         }
     }
     
 
     XmlNodeList definitionNodeList = xmlNode.SelectNodes("definition");
     if (definitionNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in definitionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 definitionIDRef = item.Attributes["id"].Name;
                 ProductReference ob = ProductReference();
                 IDManager.SetID(definitionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 definitionIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 definition = new ProductReference(item);
             }
         }
     }
     
 
 }
        public UnderlyingAsset(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");

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

            foreach (XmlNode item in currencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyIDRef = item.Attributes["id"].Name;
                        IdentifiedCurrency ob = IdentifiedCurrency();
                        IDManager.SetID(currencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency = new IdentifiedCurrency(item);
                    }
                }
            }


            XmlNodeList exchangeIdNodeList = xmlNode.SelectNodes("exchangeId");

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

            foreach (XmlNode item in exchangeIdNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exchangeIdIDRef = item.Attributes["id"].Name;
                        ExchangeId ob = ExchangeId();
                        IDManager.SetID(exchangeIdIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exchangeIdIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exchangeId = new ExchangeId(item);
                    }
                }
            }


            XmlNodeList clearanceSystemNodeList = xmlNode.SelectNodes("clearanceSystem");

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

            foreach (XmlNode item in clearanceSystemNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        clearanceSystemIDRef = item.Attributes["id"].Name;
                        ClearanceSystem ob = ClearanceSystem();
                        IDManager.SetID(clearanceSystemIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        clearanceSystemIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        clearanceSystem = new ClearanceSystem(item);
                    }
                }
            }


            XmlNodeList definitionNodeList = xmlNode.SelectNodes("definition");

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

            foreach (XmlNode item in definitionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        definitionIDRef = item.Attributes["id"].Name;
                        ProductReference ob = ProductReference();
                        IDManager.SetID(definitionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        definitionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        definition = new ProductReference(item);
                    }
                }
            }
        }
 public CurveInstrument(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 Currency ob = new Currency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new Currency(currencyNode);
             }
         }
         else
         {
             currency_ = new Currency(currencyNode);
         }
     }
     
 
     XmlNode exchangeIdNode = xmlNode.SelectSingleNode("exchangeId");
     
     if (exchangeIdNode != null)
     {
         if (exchangeIdNode.Attributes["href"] != null || exchangeIdNode.Attributes["id"] != null) 
         {
             if (exchangeIdNode.Attributes["id"] != null) 
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["id"].Value;
                 ExchangeId ob = new ExchangeId(exchangeIdNode);
                 IDManager.SetID(exchangeIdIDRef_, ob);
             }
             else if (exchangeIdNode.Attributes["href"] != null)
             {
                 exchangeIdIDRef_ = exchangeIdNode.Attributes["href"].Value;
             }
             else
             {
                 exchangeId_ = new ExchangeId(exchangeIdNode);
             }
         }
         else
         {
             exchangeId_ = new ExchangeId(exchangeIdNode);
         }
     }
     
 
     XmlNode clearanceSystemNode = xmlNode.SelectSingleNode("clearanceSystem");
     
     if (clearanceSystemNode != null)
     {
         if (clearanceSystemNode.Attributes["href"] != null || clearanceSystemNode.Attributes["id"] != null) 
         {
             if (clearanceSystemNode.Attributes["id"] != null) 
             {
                 clearanceSystemIDRef_ = clearanceSystemNode.Attributes["id"].Value;
                 ClearanceSystem ob = new ClearanceSystem(clearanceSystemNode);
                 IDManager.SetID(clearanceSystemIDRef_, ob);
             }
             else if (clearanceSystemNode.Attributes["href"] != null)
             {
                 clearanceSystemIDRef_ = clearanceSystemNode.Attributes["href"].Value;
             }
             else
             {
                 clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
             }
         }
         else
         {
             clearanceSystem_ = new ClearanceSystem(clearanceSystemNode);
         }
     }
     
 
     XmlNode definitionNode = xmlNode.SelectSingleNode("definition");
     
     if (definitionNode != null)
     {
         if (definitionNode.Attributes["href"] != null || definitionNode.Attributes["id"] != null) 
         {
             if (definitionNode.Attributes["id"] != null) 
             {
                 definitionIDRef_ = definitionNode.Attributes["id"].Value;
                 ProductReference ob = new ProductReference(definitionNode);
                 IDManager.SetID(definitionIDRef_, ob);
             }
             else if (definitionNode.Attributes["href"] != null)
             {
                 definitionIDRef_ = definitionNode.Attributes["href"].Value;
             }
             else
             {
                 definition_ = new ProductReference(definitionNode);
             }
         }
         else
         {
             definition_ = new ProductReference(definitionNode);
         }
     }
     
 
 }