public EquityPremium(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");

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


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

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


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

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


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

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


            XmlNode premiumTypeNode = xmlNode.SelectSingleNode("premiumType");

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


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

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


            XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");

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


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

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


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

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


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

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

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


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

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


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

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


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

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


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

            if (presentValueAmountNode != null)
            {
                if (presentValueAmountNode.Attributes["href"] != null || presentValueAmountNode.Attributes["id"] != null)
                {
                    if (presentValueAmountNode.Attributes["id"] != null)
                    {
                        presentValueAmountIDRef_ = presentValueAmountNode.Attributes["id"].Value;
                        Money ob = new Money(presentValueAmountNode);
                        IDManager.SetID(presentValueAmountIDRef_, ob);
                    }
                    else if (presentValueAmountNode.Attributes["href"] != null)
                    {
                        presentValueAmountIDRef_ = presentValueAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        presentValueAmount_ = new Money(presentValueAmountNode);
                    }
                }
                else
                {
                    presentValueAmount_ = new Money(presentValueAmountNode);
                }
            }
        }
 public EquityPremium(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode payerPartyReferenceNode = xmlNode.SelectSingleNode("payerPartyReference");
     
     if (payerPartyReferenceNode != null)
     {
         if (payerPartyReferenceNode.Attributes["href"] != null || payerPartyReferenceNode.Attributes["id"] != null) 
         {
             if (payerPartyReferenceNode.Attributes["id"] != null) 
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(payerPartyReferenceNode);
                 IDManager.SetID(payerPartyReferenceIDRef_, ob);
             }
             else if (payerPartyReferenceNode.Attributes["href"] != null)
             {
                 payerPartyReferenceIDRef_ = payerPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
             }
         }
         else
         {
             payerPartyReference_ = new PartyReference(payerPartyReferenceNode);
         }
     }
     
 
     XmlNode payerAccountReferenceNode = xmlNode.SelectSingleNode("payerAccountReference");
     
     if (payerAccountReferenceNode != null)
     {
         if (payerAccountReferenceNode.Attributes["href"] != null || payerAccountReferenceNode.Attributes["id"] != null) 
         {
             if (payerAccountReferenceNode.Attributes["id"] != null) 
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(payerAccountReferenceNode);
                 IDManager.SetID(payerAccountReferenceIDRef_, ob);
             }
             else if (payerAccountReferenceNode.Attributes["href"] != null)
             {
                 payerAccountReferenceIDRef_ = payerAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
             }
         }
         else
         {
             payerAccountReference_ = new AccountReference(payerAccountReferenceNode);
         }
     }
     
 
     XmlNode receiverPartyReferenceNode = xmlNode.SelectSingleNode("receiverPartyReference");
     
     if (receiverPartyReferenceNode != null)
     {
         if (receiverPartyReferenceNode.Attributes["href"] != null || receiverPartyReferenceNode.Attributes["id"] != null) 
         {
             if (receiverPartyReferenceNode.Attributes["id"] != null) 
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(receiverPartyReferenceNode);
                 IDManager.SetID(receiverPartyReferenceIDRef_, ob);
             }
             else if (receiverPartyReferenceNode.Attributes["href"] != null)
             {
                 receiverPartyReferenceIDRef_ = receiverPartyReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
             }
         }
         else
         {
             receiverPartyReference_ = new PartyReference(receiverPartyReferenceNode);
         }
     }
     
 
     XmlNode receiverAccountReferenceNode = xmlNode.SelectSingleNode("receiverAccountReference");
     
     if (receiverAccountReferenceNode != null)
     {
         if (receiverAccountReferenceNode.Attributes["href"] != null || receiverAccountReferenceNode.Attributes["id"] != null) 
         {
             if (receiverAccountReferenceNode.Attributes["id"] != null) 
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["id"].Value;
                 AccountReference ob = new AccountReference(receiverAccountReferenceNode);
                 IDManager.SetID(receiverAccountReferenceIDRef_, ob);
             }
             else if (receiverAccountReferenceNode.Attributes["href"] != null)
             {
                 receiverAccountReferenceIDRef_ = receiverAccountReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
             }
         }
         else
         {
             receiverAccountReference_ = new AccountReference(receiverAccountReferenceNode);
         }
     }
     
 
     XmlNode premiumTypeNode = xmlNode.SelectSingleNode("premiumType");
     
     if (premiumTypeNode != null)
     {
         if (premiumTypeNode.Attributes["href"] != null || premiumTypeNode.Attributes["id"] != null) 
         {
             if (premiumTypeNode.Attributes["id"] != null) 
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["id"].Value;
                 PremiumTypeEnum ob = new PremiumTypeEnum(premiumTypeNode);
                 IDManager.SetID(premiumTypeIDRef_, ob);
             }
             else if (premiumTypeNode.Attributes["href"] != null)
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["href"].Value;
             }
             else
             {
                 premiumType_ = new PremiumTypeEnum(premiumTypeNode);
             }
         }
         else
         {
             premiumType_ = new PremiumTypeEnum(premiumTypeNode);
         }
     }
     
 
     XmlNode paymentAmountNode = xmlNode.SelectSingleNode("paymentAmount");
     
     if (paymentAmountNode != null)
     {
         if (paymentAmountNode.Attributes["href"] != null || paymentAmountNode.Attributes["id"] != null) 
         {
             if (paymentAmountNode.Attributes["id"] != null) 
             {
                 paymentAmountIDRef_ = paymentAmountNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(paymentAmountNode);
                 IDManager.SetID(paymentAmountIDRef_, ob);
             }
             else if (paymentAmountNode.Attributes["href"] != null)
             {
                 paymentAmountIDRef_ = paymentAmountNode.Attributes["href"].Value;
             }
             else
             {
                 paymentAmount_ = new NonNegativeMoney(paymentAmountNode);
             }
         }
         else
         {
             paymentAmount_ = new NonNegativeMoney(paymentAmountNode);
         }
     }
     
 
     XmlNode paymentDateNode = xmlNode.SelectSingleNode("paymentDate");
     
     if (paymentDateNode != null)
     {
         if (paymentDateNode.Attributes["href"] != null || paymentDateNode.Attributes["id"] != null) 
         {
             if (paymentDateNode.Attributes["id"] != null) 
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["id"].Value;
                 AdjustableDate ob = new AdjustableDate(paymentDateNode);
                 IDManager.SetID(paymentDateIDRef_, ob);
             }
             else if (paymentDateNode.Attributes["href"] != null)
             {
                 paymentDateIDRef_ = paymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDate_ = new AdjustableDate(paymentDateNode);
             }
         }
         else
         {
             paymentDate_ = new AdjustableDate(paymentDateNode);
         }
     }
     
 
     XmlNode swapPremiumNode = xmlNode.SelectSingleNode("swapPremium");
     
     if (swapPremiumNode != null)
     {
         if (swapPremiumNode.Attributes["href"] != null || swapPremiumNode.Attributes["id"] != null) 
         {
             if (swapPremiumNode.Attributes["id"] != null) 
             {
                 swapPremiumIDRef_ = swapPremiumNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(swapPremiumNode);
                 IDManager.SetID(swapPremiumIDRef_, ob);
             }
             else if (swapPremiumNode.Attributes["href"] != null)
             {
                 swapPremiumIDRef_ = swapPremiumNode.Attributes["href"].Value;
             }
             else
             {
                 swapPremium_ = new XsdTypeBoolean(swapPremiumNode);
             }
         }
         else
         {
             swapPremium_ = new XsdTypeBoolean(swapPremiumNode);
         }
     }
     
 
     XmlNode pricePerOptionNode = xmlNode.SelectSingleNode("pricePerOption");
     
     if (pricePerOptionNode != null)
     {
         if (pricePerOptionNode.Attributes["href"] != null || pricePerOptionNode.Attributes["id"] != null) 
         {
             if (pricePerOptionNode.Attributes["id"] != null) 
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["id"].Value;
                 NonNegativeMoney ob = new NonNegativeMoney(pricePerOptionNode);
                 IDManager.SetID(pricePerOptionIDRef_, ob);
             }
             else if (pricePerOptionNode.Attributes["href"] != null)
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["href"].Value;
             }
             else
             {
                 pricePerOption_ = new NonNegativeMoney(pricePerOptionNode);
             }
         }
         else
         {
             pricePerOption_ = new NonNegativeMoney(pricePerOptionNode);
         }
     }
     
 
     XmlNode percentageOfNotionalNode = xmlNode.SelectSingleNode("percentageOfNotional");
     
     if (percentageOfNotionalNode != null)
     {
         if (percentageOfNotionalNode.Attributes["href"] != null || percentageOfNotionalNode.Attributes["id"] != null) 
         {
             if (percentageOfNotionalNode.Attributes["id"] != null) 
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(percentageOfNotionalNode);
                 IDManager.SetID(percentageOfNotionalIDRef_, ob);
             }
             else if (percentageOfNotionalNode.Attributes["href"] != null)
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["href"].Value;
             }
             else
             {
                 percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
             }
         }
         else
         {
             percentageOfNotional_ = new NonNegativeDecimal(percentageOfNotionalNode);
         }
     }
     
 
 }
        public EquityPremium(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList payerPartyReferenceNodeList = xmlNode.SelectNodes("payerPartyReference");

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

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


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

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

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


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

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

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


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

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

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


            XmlNodeList premiumTypeNodeList = xmlNode.SelectNodes("premiumType");

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

            foreach (XmlNode item in premiumTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        premiumTypeIDRef = item.Attributes["id"].Name;
                        PremiumTypeEnum ob = PremiumTypeEnum();
                        IDManager.SetID(premiumTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premiumType = new PremiumTypeEnum(item);
                    }
                }
            }


            XmlNodeList paymentAmountNodeList = xmlNode.SelectNodes("paymentAmount");

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

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


            XmlNodeList paymentDateNodeList = xmlNode.SelectNodes("paymentDate");

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

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


            XmlNodeList swapPremiumNodeList = xmlNode.SelectNodes("swapPremium");

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

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


            XmlNodeList pricePerOptionNodeList = xmlNode.SelectNodes("pricePerOption");

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

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


            XmlNodeList percentageOfNotionalNodeList = xmlNode.SelectNodes("percentageOfNotional");

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

            foreach (XmlNode item in percentageOfNotionalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        percentageOfNotionalIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(percentageOfNotionalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        percentageOfNotionalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        percentageOfNotional = new NonNegativeDecimal(item);
                    }
                }
            }
        }
        public Premium(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList premiumTypeNodeList = xmlNode.SelectNodes("premiumType");

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

            foreach (XmlNode item in premiumTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        premiumTypeIDRef = item.Attributes["id"].Name;
                        PremiumTypeEnum ob = PremiumTypeEnum();
                        IDManager.SetID(premiumTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        premiumTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        premiumType = new PremiumTypeEnum(item);
                    }
                }
            }


            XmlNodeList pricePerOptionNodeList = xmlNode.SelectNodes("pricePerOption");

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

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


            XmlNodeList percentageOfNotionalNodeList = xmlNode.SelectNodes("percentageOfNotional");

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

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


            XmlNodeList discountFactorNodeList = xmlNode.SelectNodes("discountFactor");

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

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


            XmlNodeList presentValueAmountNodeList = xmlNode.SelectNodes("presentValueAmount");

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

            foreach (XmlNode item in presentValueAmountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        presentValueAmountIDRef = item.Attributes["id"].Name;
                        Money ob = Money();
                        IDManager.SetID(presentValueAmountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        presentValueAmountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        presentValueAmount = new Money(item);
                    }
                }
            }
        }
 public Premium(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode premiumTypeNode = xmlNode.SelectSingleNode("premiumType");
     
     if (premiumTypeNode != null)
     {
         if (premiumTypeNode.Attributes["href"] != null || premiumTypeNode.Attributes["id"] != null) 
         {
             if (premiumTypeNode.Attributes["id"] != null) 
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["id"].Value;
                 PremiumTypeEnum ob = new PremiumTypeEnum(premiumTypeNode);
                 IDManager.SetID(premiumTypeIDRef_, ob);
             }
             else if (premiumTypeNode.Attributes["href"] != null)
             {
                 premiumTypeIDRef_ = premiumTypeNode.Attributes["href"].Value;
             }
             else
             {
                 premiumType_ = new PremiumTypeEnum(premiumTypeNode);
             }
         }
         else
         {
             premiumType_ = new PremiumTypeEnum(premiumTypeNode);
         }
     }
     
 
     XmlNode pricePerOptionNode = xmlNode.SelectSingleNode("pricePerOption");
     
     if (pricePerOptionNode != null)
     {
         if (pricePerOptionNode.Attributes["href"] != null || pricePerOptionNode.Attributes["id"] != null) 
         {
             if (pricePerOptionNode.Attributes["id"] != null) 
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["id"].Value;
                 Money ob = new Money(pricePerOptionNode);
                 IDManager.SetID(pricePerOptionIDRef_, ob);
             }
             else if (pricePerOptionNode.Attributes["href"] != null)
             {
                 pricePerOptionIDRef_ = pricePerOptionNode.Attributes["href"].Value;
             }
             else
             {
                 pricePerOption_ = new Money(pricePerOptionNode);
             }
         }
         else
         {
             pricePerOption_ = new Money(pricePerOptionNode);
         }
     }
     
 
     XmlNode percentageOfNotionalNode = xmlNode.SelectSingleNode("percentageOfNotional");
     
     if (percentageOfNotionalNode != null)
     {
         if (percentageOfNotionalNode.Attributes["href"] != null || percentageOfNotionalNode.Attributes["id"] != null) 
         {
             if (percentageOfNotionalNode.Attributes["id"] != null) 
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(percentageOfNotionalNode);
                 IDManager.SetID(percentageOfNotionalIDRef_, ob);
             }
             else if (percentageOfNotionalNode.Attributes["href"] != null)
             {
                 percentageOfNotionalIDRef_ = percentageOfNotionalNode.Attributes["href"].Value;
             }
             else
             {
                 percentageOfNotional_ = new XsdTypeDecimal(percentageOfNotionalNode);
             }
         }
         else
         {
             percentageOfNotional_ = new XsdTypeDecimal(percentageOfNotionalNode);
         }
     }
     
 
     XmlNode discountFactorNode = xmlNode.SelectSingleNode("discountFactor");
     
     if (discountFactorNode != null)
     {
         if (discountFactorNode.Attributes["href"] != null || discountFactorNode.Attributes["id"] != null) 
         {
             if (discountFactorNode.Attributes["id"] != null) 
             {
                 discountFactorIDRef_ = discountFactorNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(discountFactorNode);
                 IDManager.SetID(discountFactorIDRef_, ob);
             }
             else if (discountFactorNode.Attributes["href"] != null)
             {
                 discountFactorIDRef_ = discountFactorNode.Attributes["href"].Value;
             }
             else
             {
                 discountFactor_ = new XsdTypeDecimal(discountFactorNode);
             }
         }
         else
         {
             discountFactor_ = new XsdTypeDecimal(discountFactorNode);
         }
     }
     
 
     XmlNode presentValueAmountNode = xmlNode.SelectSingleNode("presentValueAmount");
     
     if (presentValueAmountNode != null)
     {
         if (presentValueAmountNode.Attributes["href"] != null || presentValueAmountNode.Attributes["id"] != null) 
         {
             if (presentValueAmountNode.Attributes["id"] != null) 
             {
                 presentValueAmountIDRef_ = presentValueAmountNode.Attributes["id"].Value;
                 Money ob = new Money(presentValueAmountNode);
                 IDManager.SetID(presentValueAmountIDRef_, ob);
             }
             else if (presentValueAmountNode.Attributes["href"] != null)
             {
                 presentValueAmountIDRef_ = presentValueAmountNode.Attributes["href"].Value;
             }
             else
             {
                 presentValueAmount_ = new Money(presentValueAmountNode);
             }
         }
         else
         {
             presentValueAmount_ = new Money(presentValueAmountNode);
         }
     }
     
 
 }