public OptionExpiry(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

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


            XmlNodeList dateNodeList = xmlNode.SelectNodes("date");

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

            foreach (XmlNode item in dateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        dateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(dateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        dateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        date = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList timeNodeList = xmlNode.SelectNodes("time");

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

            foreach (XmlNode item in timeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        timeIDRef = item.Attributes["id"].Name;
                        XsdTypeTime ob = XsdTypeTime();
                        IDManager.SetID(timeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        timeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        time = new XsdTypeTime(item);
                    }
                }
            }


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

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

            foreach (XmlNode item in exerciseProcedureNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseProcedureIDRef = item.Attributes["id"].Name;
                        ExerciseProcedureOption ob = ExerciseProcedureOption();
                        IDManager.SetID(exerciseProcedureIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseProcedureIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseProcedure = new ExerciseProcedureOption(item);
                    }
                }
            }
        }
Beispiel #2
0
        public OptionExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList optionSellerNodeList = xmlNode.SelectNodes("optionSeller");

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

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


            XmlNodeList optionBuyerNodeList = xmlNode.SelectNodes("optionBuyer");

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

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


            XmlNodeList originalTradeNodeList = xmlNode.SelectNodes("originalTrade");

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

            foreach (XmlNode item in originalTradeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        originalTradeIDRef = item.Attributes["id"].Name;
                        Trade ob = Trade();
                        IDManager.SetID(originalTradeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        originalTradeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        originalTrade = new Trade(item);
                    }
                }
            }


            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

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


            XmlNodeList exerciseDateNodeList = xmlNode.SelectNodes("exerciseDate");

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

            foreach (XmlNode item in exerciseDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(exerciseDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList exerciseTimeNodeList = xmlNode.SelectNodes("exerciseTime");

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

            foreach (XmlNode item in exerciseTimeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        exerciseTimeIDRef = item.Attributes["id"].Name;
                        XsdTypeTime ob = XsdTypeTime();
                        IDManager.SetID(exerciseTimeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        exerciseTimeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        exerciseTime = new XsdTypeTime(item);
                    }
                }
            }


            XmlNodeList expiryNodeList = xmlNode.SelectNodes("expiry");

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

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


            XmlNodeList fullExerciseNodeList = xmlNode.SelectNodes("fullExercise");

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

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


            XmlNodeList exerciseInNotionalAmountNodeList = xmlNode.SelectNodes("exerciseInNotionalAmount");

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

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


            XmlNodeList outstandingNotionalAmountNodeList = xmlNode.SelectNodes("outstandingNotionalAmount");

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

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


            XmlNodeList exerciseInNumberOfOptionsNodeList = xmlNode.SelectNodes("exerciseInNumberOfOptions");

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

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


            XmlNodeList outstandingNumberOfOptionsNodeList = xmlNode.SelectNodes("outstandingNumberOfOptions");

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

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


            XmlNodeList exerciseInNumberOfUnitsNodeList = xmlNode.SelectNodes("exerciseInNumberOfUnits");

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

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


            XmlNodeList outstandingNumberOfUnitsNodeList = xmlNode.SelectNodes("outstandingNumberOfUnits");

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

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


            XmlNodeList settlementTypeNodeList = xmlNode.SelectNodes("settlementType");

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

            foreach (XmlNode item in settlementTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        settlementTypeIDRef = item.Attributes["id"].Name;
                        SettlementTypeEnum ob = SettlementTypeEnum();
                        IDManager.SetID(settlementTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        settlementTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        settlementType = new SettlementTypeEnum(item);
                    }
                }
            }


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

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

            foreach (XmlNode item in cashSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        cashSettlementIDRef = item.Attributes["id"].Name;
                        SimplePayment ob = SimplePayment();
                        IDManager.SetID(cashSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        cashSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cashSettlement = new SimplePayment(item);
                    }
                }
            }


            XmlNodeList physicalSettlementNodeList = xmlNode.SelectNodes("physicalSettlement");

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

            foreach (XmlNode item in physicalSettlementNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalSettlementIDRef = item.Attributes["id"].Name;
                        PhysicalSettlement ob = PhysicalSettlement();
                        IDManager.SetID(physicalSettlementIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalSettlementIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalSettlement = new PhysicalSettlement(item);
                    }
                }
            }


            XmlNodeList paymentNodeList = xmlNode.SelectNodes("payment");

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

            foreach (XmlNode item in paymentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentIDRef = item.Attributes["id"].Name;
                        NonNegativePayment ob = NonNegativePayment();
                        IDManager.SetID(paymentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payment = new NonNegativePayment(item);
                    }
                }
            }
        }
        public OptionExpiry(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

            if (tradeIdentifierNodeList != null)
            {
                this.tradeIdentifier_ = new List <PartyTradeIdentifier>();
                foreach (XmlNode item in tradeIdentifierNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                            IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                        }
                    }
                    else
                    {
                        tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                    }
                }
            }


            XmlNode dateNode = xmlNode.SelectSingleNode("date");

            if (dateNode != null)
            {
                if (dateNode.Attributes["href"] != null || dateNode.Attributes["id"] != null)
                {
                    if (dateNode.Attributes["id"] != null)
                    {
                        dateIDRef_ = dateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(dateNode);
                        IDManager.SetID(dateIDRef_, ob);
                    }
                    else if (dateNode.Attributes["href"] != null)
                    {
                        dateIDRef_ = dateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        date_ = new XsdTypeDate(dateNode);
                    }
                }
                else
                {
                    date_ = new XsdTypeDate(dateNode);
                }
            }


            XmlNode timeNode = xmlNode.SelectSingleNode("time");

            if (timeNode != null)
            {
                if (timeNode.Attributes["href"] != null || timeNode.Attributes["id"] != null)
                {
                    if (timeNode.Attributes["id"] != null)
                    {
                        timeIDRef_ = timeNode.Attributes["id"].Value;
                        XsdTypeTime ob = new XsdTypeTime(timeNode);
                        IDManager.SetID(timeIDRef_, ob);
                    }
                    else if (timeNode.Attributes["href"] != null)
                    {
                        timeIDRef_ = timeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        time_ = new XsdTypeTime(timeNode);
                    }
                }
                else
                {
                    time_ = new XsdTypeTime(timeNode);
                }
            }


            XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure");

            if (exerciseProcedureNode != null)
            {
                if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null)
                {
                    if (exerciseProcedureNode.Attributes["id"] != null)
                    {
                        exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value;
                        ExerciseProcedureOption ob = new ExerciseProcedureOption(exerciseProcedureNode);
                        IDManager.SetID(exerciseProcedureIDRef_, ob);
                    }
                    else if (exerciseProcedureNode.Attributes["href"] != null)
                    {
                        exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseProcedure_ = new ExerciseProcedureOption(exerciseProcedureNode);
                    }
                }
                else
                {
                    exerciseProcedure_ = new ExerciseProcedureOption(exerciseProcedureNode);
                }
            }
        }
        public OptionExercise(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller");

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


            XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer");

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


            XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade");

            if (originalTradeNode != null)
            {
                if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null)
                {
                    if (originalTradeNode.Attributes["id"] != null)
                    {
                        originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value;
                        Trade ob = new Trade(originalTradeNode);
                        IDManager.SetID(originalTradeIDRef_, ob);
                    }
                    else if (originalTradeNode.Attributes["href"] != null)
                    {
                        originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        originalTrade_ = new Trade(originalTradeNode);
                    }
                }
                else
                {
                    originalTrade_ = new Trade(originalTradeNode);
                }
            }


            XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");

            if (tradeIdentifierNodeList != null)
            {
                this.tradeIdentifier_ = new List <PartyTradeIdentifier>();
                foreach (XmlNode item in tradeIdentifierNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                            IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                        }
                    }
                    else
                    {
                        tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                    }
                }
            }


            XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate");

            if (exerciseDateNode != null)
            {
                if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null)
                {
                    if (exerciseDateNode.Attributes["id"] != null)
                    {
                        exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(exerciseDateNode);
                        IDManager.SetID(exerciseDateIDRef_, ob);
                    }
                    else if (exerciseDateNode.Attributes["href"] != null)
                    {
                        exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseDate_ = new XsdTypeDate(exerciseDateNode);
                    }
                }
                else
                {
                    exerciseDate_ = new XsdTypeDate(exerciseDateNode);
                }
            }


            XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime");

            if (exerciseTimeNode != null)
            {
                if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null)
                {
                    if (exerciseTimeNode.Attributes["id"] != null)
                    {
                        exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value;
                        XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode);
                        IDManager.SetID(exerciseTimeIDRef_, ob);
                    }
                    else if (exerciseTimeNode.Attributes["href"] != null)
                    {
                        exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
                    }
                }
                else
                {
                    exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
                }
            }


            XmlNode expiryNode = xmlNode.SelectSingleNode("expiry");

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


            XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise");

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


            XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount");

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


            XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount");

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


            XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions");

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


            XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions");

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


            XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits");

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


            XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits");

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


            XmlNode settlementTypeNode = xmlNode.SelectSingleNode("settlementType");

            if (settlementTypeNode != null)
            {
                if (settlementTypeNode.Attributes["href"] != null || settlementTypeNode.Attributes["id"] != null)
                {
                    if (settlementTypeNode.Attributes["id"] != null)
                    {
                        settlementTypeIDRef_ = settlementTypeNode.Attributes["id"].Value;
                        SettlementTypeEnum ob = new SettlementTypeEnum(settlementTypeNode);
                        IDManager.SetID(settlementTypeIDRef_, ob);
                    }
                    else if (settlementTypeNode.Attributes["href"] != null)
                    {
                        settlementTypeIDRef_ = settlementTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        settlementType_ = new SettlementTypeEnum(settlementTypeNode);
                    }
                }
                else
                {
                    settlementType_ = new SettlementTypeEnum(settlementTypeNode);
                }
            }


            XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");

            if (cashSettlementNode != null)
            {
                if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null)
                {
                    if (cashSettlementNode.Attributes["id"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                        SimplePayment ob = new SimplePayment(cashSettlementNode);
                        IDManager.SetID(cashSettlementIDRef_, ob);
                    }
                    else if (cashSettlementNode.Attributes["href"] != null)
                    {
                        cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        cashSettlement_ = new SimplePayment(cashSettlementNode);
                    }
                }
                else
                {
                    cashSettlement_ = new SimplePayment(cashSettlementNode);
                }
            }


            XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement");

            if (physicalSettlementNode != null)
            {
                if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null)
                {
                    if (physicalSettlementNode.Attributes["id"] != null)
                    {
                        physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value;
                        PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode);
                        IDManager.SetID(physicalSettlementIDRef_, ob);
                    }
                    else if (physicalSettlementNode.Attributes["href"] != null)
                    {
                        physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
                    }
                }
                else
                {
                    physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
                }
            }


            XmlNode paymentNode = xmlNode.SelectSingleNode("payment");

            if (paymentNode != null)
            {
                if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null)
                {
                    if (paymentNode.Attributes["id"] != null)
                    {
                        paymentIDRef_ = paymentNode.Attributes["id"].Value;
                        NonNegativePayment ob = new NonNegativePayment(paymentNode);
                        IDManager.SetID(paymentIDRef_, ob);
                    }
                    else if (paymentNode.Attributes["href"] != null)
                    {
                        paymentIDRef_ = paymentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payment_ = new NonNegativePayment(paymentNode);
                    }
                }
                else
                {
                    payment_ = new NonNegativePayment(paymentNode);
                }
            }
        }
 public OptionExercise(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode optionSellerNode = xmlNode.SelectSingleNode("optionSeller");
     
     if (optionSellerNode != null)
     {
         if (optionSellerNode.Attributes["href"] != null || optionSellerNode.Attributes["id"] != null) 
         {
             if (optionSellerNode.Attributes["id"] != null) 
             {
                 optionSellerIDRef_ = optionSellerNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(optionSellerNode);
                 IDManager.SetID(optionSellerIDRef_, ob);
             }
             else if (optionSellerNode.Attributes["href"] != null)
             {
                 optionSellerIDRef_ = optionSellerNode.Attributes["href"].Value;
             }
             else
             {
                 optionSeller_ = new PartyReference(optionSellerNode);
             }
         }
         else
         {
             optionSeller_ = new PartyReference(optionSellerNode);
         }
     }
     
 
     XmlNode optionBuyerNode = xmlNode.SelectSingleNode("optionBuyer");
     
     if (optionBuyerNode != null)
     {
         if (optionBuyerNode.Attributes["href"] != null || optionBuyerNode.Attributes["id"] != null) 
         {
             if (optionBuyerNode.Attributes["id"] != null) 
             {
                 optionBuyerIDRef_ = optionBuyerNode.Attributes["id"].Value;
                 PartyReference ob = new PartyReference(optionBuyerNode);
                 IDManager.SetID(optionBuyerIDRef_, ob);
             }
             else if (optionBuyerNode.Attributes["href"] != null)
             {
                 optionBuyerIDRef_ = optionBuyerNode.Attributes["href"].Value;
             }
             else
             {
                 optionBuyer_ = new PartyReference(optionBuyerNode);
             }
         }
         else
         {
             optionBuyer_ = new PartyReference(optionBuyerNode);
         }
     }
     
 
     XmlNode originalTradeNode = xmlNode.SelectSingleNode("originalTrade");
     
     if (originalTradeNode != null)
     {
         if (originalTradeNode.Attributes["href"] != null || originalTradeNode.Attributes["id"] != null) 
         {
             if (originalTradeNode.Attributes["id"] != null) 
             {
                 originalTradeIDRef_ = originalTradeNode.Attributes["id"].Value;
                 Trade ob = new Trade(originalTradeNode);
                 IDManager.SetID(originalTradeIDRef_, ob);
             }
             else if (originalTradeNode.Attributes["href"] != null)
             {
                 originalTradeIDRef_ = originalTradeNode.Attributes["href"].Value;
             }
             else
             {
                 originalTrade_ = new Trade(originalTradeNode);
             }
         }
         else
         {
             originalTrade_ = new Trade(originalTradeNode);
         }
     }
     
 
     XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");
     
     if (tradeIdentifierNodeList != null)
     {
         this.tradeIdentifier_ = new List<PartyTradeIdentifier>();
         foreach (XmlNode item in tradeIdentifierNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                     tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                     IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                 }
             }
             else
             {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNode exerciseDateNode = xmlNode.SelectSingleNode("exerciseDate");
     
     if (exerciseDateNode != null)
     {
         if (exerciseDateNode.Attributes["href"] != null || exerciseDateNode.Attributes["id"] != null) 
         {
             if (exerciseDateNode.Attributes["id"] != null) 
             {
                 exerciseDateIDRef_ = exerciseDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(exerciseDateNode);
                 IDManager.SetID(exerciseDateIDRef_, ob);
             }
             else if (exerciseDateNode.Attributes["href"] != null)
             {
                 exerciseDateIDRef_ = exerciseDateNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseDate_ = new XsdTypeDate(exerciseDateNode);
             }
         }
         else
         {
             exerciseDate_ = new XsdTypeDate(exerciseDateNode);
         }
     }
     
 
     XmlNode exerciseTimeNode = xmlNode.SelectSingleNode("exerciseTime");
     
     if (exerciseTimeNode != null)
     {
         if (exerciseTimeNode.Attributes["href"] != null || exerciseTimeNode.Attributes["id"] != null) 
         {
             if (exerciseTimeNode.Attributes["id"] != null) 
             {
                 exerciseTimeIDRef_ = exerciseTimeNode.Attributes["id"].Value;
                 XsdTypeTime ob = new XsdTypeTime(exerciseTimeNode);
                 IDManager.SetID(exerciseTimeIDRef_, ob);
             }
             else if (exerciseTimeNode.Attributes["href"] != null)
             {
                 exerciseTimeIDRef_ = exerciseTimeNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
             }
         }
         else
         {
             exerciseTime_ = new XsdTypeTime(exerciseTimeNode);
         }
     }
     
 
     XmlNode expiryNode = xmlNode.SelectSingleNode("expiry");
     
     if (expiryNode != null)
     {
         if (expiryNode.Attributes["href"] != null || expiryNode.Attributes["id"] != null) 
         {
             if (expiryNode.Attributes["id"] != null) 
             {
                 expiryIDRef_ = expiryNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(expiryNode);
                 IDManager.SetID(expiryIDRef_, ob);
             }
             else if (expiryNode.Attributes["href"] != null)
             {
                 expiryIDRef_ = expiryNode.Attributes["href"].Value;
             }
             else
             {
                 expiry_ = new XsdTypeBoolean(expiryNode);
             }
         }
         else
         {
             expiry_ = new XsdTypeBoolean(expiryNode);
         }
     }
     
 
     XmlNode fullExerciseNode = xmlNode.SelectSingleNode("fullExercise");
     
     if (fullExerciseNode != null)
     {
         if (fullExerciseNode.Attributes["href"] != null || fullExerciseNode.Attributes["id"] != null) 
         {
             if (fullExerciseNode.Attributes["id"] != null) 
             {
                 fullExerciseIDRef_ = fullExerciseNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(fullExerciseNode);
                 IDManager.SetID(fullExerciseIDRef_, ob);
             }
             else if (fullExerciseNode.Attributes["href"] != null)
             {
                 fullExerciseIDRef_ = fullExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
             }
         }
         else
         {
             fullExercise_ = new XsdTypeBoolean(fullExerciseNode);
         }
     }
     
 
     XmlNode exerciseInNotionalAmountNode = xmlNode.SelectSingleNode("exerciseInNotionalAmount");
     
     if (exerciseInNotionalAmountNode != null)
     {
         if (exerciseInNotionalAmountNode.Attributes["href"] != null || exerciseInNotionalAmountNode.Attributes["id"] != null) 
         {
             if (exerciseInNotionalAmountNode.Attributes["id"] != null) 
             {
                 exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["id"].Value;
                 Money ob = new Money(exerciseInNotionalAmountNode);
                 IDManager.SetID(exerciseInNotionalAmountIDRef_, ob);
             }
             else if (exerciseInNotionalAmountNode.Attributes["href"] != null)
             {
                 exerciseInNotionalAmountIDRef_ = exerciseInNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
             }
         }
         else
         {
             exerciseInNotionalAmount_ = new Money(exerciseInNotionalAmountNode);
         }
     }
     
 
     XmlNode outstandingNotionalAmountNode = xmlNode.SelectSingleNode("outstandingNotionalAmount");
     
     if (outstandingNotionalAmountNode != null)
     {
         if (outstandingNotionalAmountNode.Attributes["href"] != null || outstandingNotionalAmountNode.Attributes["id"] != null) 
         {
             if (outstandingNotionalAmountNode.Attributes["id"] != null) 
             {
                 outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["id"].Value;
                 Money ob = new Money(outstandingNotionalAmountNode);
                 IDManager.SetID(outstandingNotionalAmountIDRef_, ob);
             }
             else if (outstandingNotionalAmountNode.Attributes["href"] != null)
             {
                 outstandingNotionalAmountIDRef_ = outstandingNotionalAmountNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
             }
         }
         else
         {
             outstandingNotionalAmount_ = new Money(outstandingNotionalAmountNode);
         }
     }
     
 
     XmlNode exerciseInNumberOfOptionsNode = xmlNode.SelectSingleNode("exerciseInNumberOfOptions");
     
     if (exerciseInNumberOfOptionsNode != null)
     {
         if (exerciseInNumberOfOptionsNode.Attributes["href"] != null || exerciseInNumberOfOptionsNode.Attributes["id"] != null) 
         {
             if (exerciseInNumberOfOptionsNode.Attributes["id"] != null) 
             {
                 exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
                 IDManager.SetID(exerciseInNumberOfOptionsIDRef_, ob);
             }
             else if (exerciseInNumberOfOptionsNode.Attributes["href"] != null)
             {
                 exerciseInNumberOfOptionsIDRef_ = exerciseInNumberOfOptionsNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
             }
         }
         else
         {
             exerciseInNumberOfOptions_ = new XsdTypeDecimal(exerciseInNumberOfOptionsNode);
         }
     }
     
 
     XmlNode outstandingNumberOfOptionsNode = xmlNode.SelectSingleNode("outstandingNumberOfOptions");
     
     if (outstandingNumberOfOptionsNode != null)
     {
         if (outstandingNumberOfOptionsNode.Attributes["href"] != null || outstandingNumberOfOptionsNode.Attributes["id"] != null) 
         {
             if (outstandingNumberOfOptionsNode.Attributes["id"] != null) 
             {
                 outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
                 IDManager.SetID(outstandingNumberOfOptionsIDRef_, ob);
             }
             else if (outstandingNumberOfOptionsNode.Attributes["href"] != null)
             {
                 outstandingNumberOfOptionsIDRef_ = outstandingNumberOfOptionsNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
             }
         }
         else
         {
             outstandingNumberOfOptions_ = new XsdTypeDecimal(outstandingNumberOfOptionsNode);
         }
     }
     
 
     XmlNode exerciseInNumberOfUnitsNode = xmlNode.SelectSingleNode("exerciseInNumberOfUnits");
     
     if (exerciseInNumberOfUnitsNode != null)
     {
         if (exerciseInNumberOfUnitsNode.Attributes["href"] != null || exerciseInNumberOfUnitsNode.Attributes["id"] != null) 
         {
             if (exerciseInNumberOfUnitsNode.Attributes["id"] != null) 
             {
                 exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
                 IDManager.SetID(exerciseInNumberOfUnitsIDRef_, ob);
             }
             else if (exerciseInNumberOfUnitsNode.Attributes["href"] != null)
             {
                 exerciseInNumberOfUnitsIDRef_ = exerciseInNumberOfUnitsNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
             }
         }
         else
         {
             exerciseInNumberOfUnits_ = new XsdTypeDecimal(exerciseInNumberOfUnitsNode);
         }
     }
     
 
     XmlNode outstandingNumberOfUnitsNode = xmlNode.SelectSingleNode("outstandingNumberOfUnits");
     
     if (outstandingNumberOfUnitsNode != null)
     {
         if (outstandingNumberOfUnitsNode.Attributes["href"] != null || outstandingNumberOfUnitsNode.Attributes["id"] != null) 
         {
             if (outstandingNumberOfUnitsNode.Attributes["id"] != null) 
             {
                 outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
                 IDManager.SetID(outstandingNumberOfUnitsIDRef_, ob);
             }
             else if (outstandingNumberOfUnitsNode.Attributes["href"] != null)
             {
                 outstandingNumberOfUnitsIDRef_ = outstandingNumberOfUnitsNode.Attributes["href"].Value;
             }
             else
             {
                 outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
             }
         }
         else
         {
             outstandingNumberOfUnits_ = new XsdTypeDecimal(outstandingNumberOfUnitsNode);
         }
     }
     
 
     XmlNode settlementTypeNode = xmlNode.SelectSingleNode("settlementType");
     
     if (settlementTypeNode != null)
     {
         if (settlementTypeNode.Attributes["href"] != null || settlementTypeNode.Attributes["id"] != null) 
         {
             if (settlementTypeNode.Attributes["id"] != null) 
             {
                 settlementTypeIDRef_ = settlementTypeNode.Attributes["id"].Value;
                 SettlementTypeEnum ob = new SettlementTypeEnum(settlementTypeNode);
                 IDManager.SetID(settlementTypeIDRef_, ob);
             }
             else if (settlementTypeNode.Attributes["href"] != null)
             {
                 settlementTypeIDRef_ = settlementTypeNode.Attributes["href"].Value;
             }
             else
             {
                 settlementType_ = new SettlementTypeEnum(settlementTypeNode);
             }
         }
         else
         {
             settlementType_ = new SettlementTypeEnum(settlementTypeNode);
         }
     }
     
 
     XmlNode cashSettlementNode = xmlNode.SelectSingleNode("cashSettlement");
     
     if (cashSettlementNode != null)
     {
         if (cashSettlementNode.Attributes["href"] != null || cashSettlementNode.Attributes["id"] != null) 
         {
             if (cashSettlementNode.Attributes["id"] != null) 
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["id"].Value;
                 SimplePayment ob = new SimplePayment(cashSettlementNode);
                 IDManager.SetID(cashSettlementIDRef_, ob);
             }
             else if (cashSettlementNode.Attributes["href"] != null)
             {
                 cashSettlementIDRef_ = cashSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 cashSettlement_ = new SimplePayment(cashSettlementNode);
             }
         }
         else
         {
             cashSettlement_ = new SimplePayment(cashSettlementNode);
         }
     }
     
 
     XmlNode physicalSettlementNode = xmlNode.SelectSingleNode("physicalSettlement");
     
     if (physicalSettlementNode != null)
     {
         if (physicalSettlementNode.Attributes["href"] != null || physicalSettlementNode.Attributes["id"] != null) 
         {
             if (physicalSettlementNode.Attributes["id"] != null) 
             {
                 physicalSettlementIDRef_ = physicalSettlementNode.Attributes["id"].Value;
                 PhysicalSettlement ob = new PhysicalSettlement(physicalSettlementNode);
                 IDManager.SetID(physicalSettlementIDRef_, ob);
             }
             else if (physicalSettlementNode.Attributes["href"] != null)
             {
                 physicalSettlementIDRef_ = physicalSettlementNode.Attributes["href"].Value;
             }
             else
             {
                 physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
             }
         }
         else
         {
             physicalSettlement_ = new PhysicalSettlement(physicalSettlementNode);
         }
     }
     
 
     XmlNode paymentNode = xmlNode.SelectSingleNode("payment");
     
     if (paymentNode != null)
     {
         if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null) 
         {
             if (paymentNode.Attributes["id"] != null) 
             {
                 paymentIDRef_ = paymentNode.Attributes["id"].Value;
                 NonNegativePayment ob = new NonNegativePayment(paymentNode);
                 IDManager.SetID(paymentIDRef_, ob);
             }
             else if (paymentNode.Attributes["href"] != null)
             {
                 paymentIDRef_ = paymentNode.Attributes["href"].Value;
             }
             else
             {
                 payment_ = new NonNegativePayment(paymentNode);
             }
         }
         else
         {
             payment_ = new NonNegativePayment(paymentNode);
         }
     }
     
 
 }
 public OptionExpiry(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList tradeIdentifierNodeList = xmlNode.SelectNodes("tradeIdentifier");
     
     if (tradeIdentifierNodeList != null)
     {
         this.tradeIdentifier_ = new List<PartyTradeIdentifier>();
         foreach (XmlNode item in tradeIdentifierNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     tradeIdentifierIDRef_ = item.Attributes["id"].Value;
                     tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                     IDManager.SetID(tradeIdentifierIDRef_, tradeIdentifier_[tradeIdentifier_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     tradeIdentifierIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
                 }
             }
             else
             {
                 tradeIdentifier_.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNode dateNode = xmlNode.SelectSingleNode("date");
     
     if (dateNode != null)
     {
         if (dateNode.Attributes["href"] != null || dateNode.Attributes["id"] != null) 
         {
             if (dateNode.Attributes["id"] != null) 
             {
                 dateIDRef_ = dateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(dateNode);
                 IDManager.SetID(dateIDRef_, ob);
             }
             else if (dateNode.Attributes["href"] != null)
             {
                 dateIDRef_ = dateNode.Attributes["href"].Value;
             }
             else
             {
                 date_ = new XsdTypeDate(dateNode);
             }
         }
         else
         {
             date_ = new XsdTypeDate(dateNode);
         }
     }
     
 
     XmlNode timeNode = xmlNode.SelectSingleNode("time");
     
     if (timeNode != null)
     {
         if (timeNode.Attributes["href"] != null || timeNode.Attributes["id"] != null) 
         {
             if (timeNode.Attributes["id"] != null) 
             {
                 timeIDRef_ = timeNode.Attributes["id"].Value;
                 XsdTypeTime ob = new XsdTypeTime(timeNode);
                 IDManager.SetID(timeIDRef_, ob);
             }
             else if (timeNode.Attributes["href"] != null)
             {
                 timeIDRef_ = timeNode.Attributes["href"].Value;
             }
             else
             {
                 time_ = new XsdTypeTime(timeNode);
             }
         }
         else
         {
             time_ = new XsdTypeTime(timeNode);
         }
     }
     
 
     XmlNode exerciseProcedureNode = xmlNode.SelectSingleNode("exerciseProcedure");
     
     if (exerciseProcedureNode != null)
     {
         if (exerciseProcedureNode.Attributes["href"] != null || exerciseProcedureNode.Attributes["id"] != null) 
         {
             if (exerciseProcedureNode.Attributes["id"] != null) 
             {
                 exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["id"].Value;
                 ExerciseProcedureOption ob = new ExerciseProcedureOption(exerciseProcedureNode);
                 IDManager.SetID(exerciseProcedureIDRef_, ob);
             }
             else if (exerciseProcedureNode.Attributes["href"] != null)
             {
                 exerciseProcedureIDRef_ = exerciseProcedureNode.Attributes["href"].Value;
             }
             else
             {
                 exerciseProcedure_ = new ExerciseProcedureOption(exerciseProcedureNode);
             }
         }
         else
         {
             exerciseProcedure_ = new ExerciseProcedureOption(exerciseProcedureNode);
         }
     }
     
 
 }