public EventProposedMatch(XmlNode xmlNode)
 {
     XmlNode originatingEventNode = xmlNode.SelectSingleNode("originatingEvent");
     
     if (originatingEventNode != null)
     {
         if (originatingEventNode.Attributes["href"] != null || originatingEventNode.Attributes["id"] != null) 
         {
             if (originatingEventNode.Attributes["id"] != null) 
             {
                 originatingEventIDRef_ = originatingEventNode.Attributes["id"].Value;
                 OriginatingEvent ob = new OriginatingEvent(originatingEventNode);
                 IDManager.SetID(originatingEventIDRef_, ob);
             }
             else if (originatingEventNode.Attributes["href"] != null)
             {
                 originatingEventIDRef_ = originatingEventNode.Attributes["href"].Value;
             }
             else
             {
                 originatingEvent_ = new OriginatingEvent(originatingEventNode);
             }
         }
         else
         {
             originatingEvent_ = new OriginatingEvent(originatingEventNode);
         }
     }
     
 
     XmlNode tradeNode = xmlNode.SelectSingleNode("trade");
     
     if (tradeNode != null)
     {
         if (tradeNode.Attributes["href"] != null || tradeNode.Attributes["id"] != null) 
         {
             if (tradeNode.Attributes["id"] != null) 
             {
                 tradeIDRef_ = tradeNode.Attributes["id"].Value;
                 Trade ob = new Trade(tradeNode);
                 IDManager.SetID(tradeIDRef_, ob);
             }
             else if (tradeNode.Attributes["href"] != null)
             {
                 tradeIDRef_ = tradeNode.Attributes["href"].Value;
             }
             else
             {
                 trade_ = new Trade(tradeNode);
             }
         }
         else
         {
             trade_ = new Trade(tradeNode);
         }
     }
     
 
     XmlNode amendmentNode = xmlNode.SelectSingleNode("amendment");
     
     if (amendmentNode != null)
     {
         if (amendmentNode.Attributes["href"] != null || amendmentNode.Attributes["id"] != null) 
         {
             if (amendmentNode.Attributes["id"] != null) 
             {
                 amendmentIDRef_ = amendmentNode.Attributes["id"].Value;
                 TradeAmendmentContent ob = new TradeAmendmentContent(amendmentNode);
                 IDManager.SetID(amendmentIDRef_, ob);
             }
             else if (amendmentNode.Attributes["href"] != null)
             {
                 amendmentIDRef_ = amendmentNode.Attributes["href"].Value;
             }
             else
             {
                 amendment_ = new TradeAmendmentContent(amendmentNode);
             }
         }
         else
         {
             amendment_ = new TradeAmendmentContent(amendmentNode);
         }
     }
     
 
     XmlNode increaseNode = xmlNode.SelectSingleNode("increase");
     
     if (increaseNode != null)
     {
         if (increaseNode.Attributes["href"] != null || increaseNode.Attributes["id"] != null) 
         {
             if (increaseNode.Attributes["id"] != null) 
             {
                 increaseIDRef_ = increaseNode.Attributes["id"].Value;
                 TradeNotionalChange ob = new TradeNotionalChange(increaseNode);
                 IDManager.SetID(increaseIDRef_, ob);
             }
             else if (increaseNode.Attributes["href"] != null)
             {
                 increaseIDRef_ = increaseNode.Attributes["href"].Value;
             }
             else
             {
                 increase_ = new TradeNotionalChange(increaseNode);
             }
         }
         else
         {
             increase_ = new TradeNotionalChange(increaseNode);
         }
     }
     
 
     XmlNode terminatingEventNode = xmlNode.SelectSingleNode("terminatingEvent");
     
     if (terminatingEventNode != null)
     {
         if (terminatingEventNode.Attributes["href"] != null || terminatingEventNode.Attributes["id"] != null) 
         {
             if (terminatingEventNode.Attributes["id"] != null) 
             {
                 terminatingEventIDRef_ = terminatingEventNode.Attributes["id"].Value;
                 TerminatingEvent ob = new TerminatingEvent(terminatingEventNode);
                 IDManager.SetID(terminatingEventIDRef_, ob);
             }
             else if (terminatingEventNode.Attributes["href"] != null)
             {
                 terminatingEventIDRef_ = terminatingEventNode.Attributes["href"].Value;
             }
             else
             {
                 terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
             }
         }
         else
         {
             terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
         }
     }
     
 
     XmlNode terminationNode = xmlNode.SelectSingleNode("termination");
     
     if (terminationNode != null)
     {
         if (terminationNode.Attributes["href"] != null || terminationNode.Attributes["id"] != null) 
         {
             if (terminationNode.Attributes["id"] != null) 
             {
                 terminationIDRef_ = terminationNode.Attributes["id"].Value;
                 TradeNotionalChange ob = new TradeNotionalChange(terminationNode);
                 IDManager.SetID(terminationIDRef_, ob);
             }
             else if (terminationNode.Attributes["href"] != null)
             {
                 terminationIDRef_ = terminationNode.Attributes["href"].Value;
             }
             else
             {
                 termination_ = new TradeNotionalChange(terminationNode);
             }
         }
         else
         {
             termination_ = new TradeNotionalChange(terminationNode);
         }
     }
     
 
     XmlNode novationNode = xmlNode.SelectSingleNode("novation");
     
     if (novationNode != null)
     {
         if (novationNode.Attributes["href"] != null || novationNode.Attributes["id"] != null) 
         {
             if (novationNode.Attributes["id"] != null) 
             {
                 novationIDRef_ = novationNode.Attributes["id"].Value;
                 TradeNovationContent ob = new TradeNovationContent(novationNode);
                 IDManager.SetID(novationIDRef_, ob);
             }
             else if (novationNode.Attributes["href"] != null)
             {
                 novationIDRef_ = novationNode.Attributes["href"].Value;
             }
             else
             {
                 novation_ = new TradeNovationContent(novationNode);
             }
         }
         else
         {
             novation_ = new TradeNovationContent(novationNode);
         }
     }
     
 
     XmlNode optionExerciseNode = xmlNode.SelectSingleNode("optionExercise");
     
     if (optionExerciseNode != null)
     {
         if (optionExerciseNode.Attributes["href"] != null || optionExerciseNode.Attributes["id"] != null) 
         {
             if (optionExerciseNode.Attributes["id"] != null) 
             {
                 optionExerciseIDRef_ = optionExerciseNode.Attributes["id"].Value;
                 OptionExercise ob = new OptionExercise(optionExerciseNode);
                 IDManager.SetID(optionExerciseIDRef_, ob);
             }
             else if (optionExerciseNode.Attributes["href"] != null)
             {
                 optionExerciseIDRef_ = optionExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 optionExercise_ = new OptionExercise(optionExerciseNode);
             }
         }
         else
         {
             optionExercise_ = new OptionExercise(optionExerciseNode);
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     if (optionExpiryNodeList != null)
     {
         this.optionExpiry_ = new List<OptionExpiry>();
         foreach (XmlNode item in optionExpiryNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     optionExpiryIDRef_ = item.Attributes["id"].Value;
                     optionExpiry_.Add(new OptionExpiry(item));
                     IDManager.SetID(optionExpiryIDRef_, optionExpiry_[optionExpiry_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     optionExpiryIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 optionExpiry_.Add(new OptionExpiry(item));
                 }
             }
             else
             {
                 optionExpiry_.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNode deClearNode = xmlNode.SelectSingleNode("deClear");
     
     if (deClearNode != null)
     {
         if (deClearNode.Attributes["href"] != null || deClearNode.Attributes["id"] != null) 
         {
             if (deClearNode.Attributes["id"] != null) 
             {
                 deClearIDRef_ = deClearNode.Attributes["id"].Value;
                 DeClear ob = new DeClear(deClearNode);
                 IDManager.SetID(deClearIDRef_, ob);
             }
             else if (deClearNode.Attributes["href"] != null)
             {
                 deClearIDRef_ = deClearNode.Attributes["href"].Value;
             }
             else
             {
                 deClear_ = new DeClear(deClearNode);
             }
         }
         else
         {
             deClear_ = new DeClear(deClearNode);
         }
     }
     
 
     XmlNode withdrawalNode = xmlNode.SelectSingleNode("withdrawal");
     
     if (withdrawalNode != null)
     {
         if (withdrawalNode.Attributes["href"] != null || withdrawalNode.Attributes["id"] != null) 
         {
             if (withdrawalNode.Attributes["id"] != null) 
             {
                 withdrawalIDRef_ = withdrawalNode.Attributes["id"].Value;
                 Withdrawal ob = new Withdrawal(withdrawalNode);
                 IDManager.SetID(withdrawalIDRef_, ob);
             }
             else if (withdrawalNode.Attributes["href"] != null)
             {
                 withdrawalIDRef_ = withdrawalNode.Attributes["href"].Value;
             }
             else
             {
                 withdrawal_ = new Withdrawal(withdrawalNode);
             }
         }
         else
         {
             withdrawal_ = new Withdrawal(withdrawalNode);
         }
     }
     
 
     XmlNode additionalEventNode = xmlNode.SelectSingleNode("additionalEvent");
     
     if (additionalEventNode != null)
     {
         if (additionalEventNode.Attributes["href"] != null || additionalEventNode.Attributes["id"] != null) 
         {
             if (additionalEventNode.Attributes["id"] != null) 
             {
                 additionalEventIDRef_ = additionalEventNode.Attributes["id"].Value;
                 AdditionalEvent ob = new AdditionalEvent(additionalEventNode);
                 IDManager.SetID(additionalEventIDRef_, ob);
             }
             else if (additionalEventNode.Attributes["href"] != null)
             {
                 additionalEventIDRef_ = additionalEventNode.Attributes["href"].Value;
             }
             else
             {
                 additionalEvent_ = new AdditionalEvent(additionalEventNode);
             }
         }
         else
         {
             additionalEvent_ = new AdditionalEvent(additionalEventNode);
         }
     }
     
 
     XmlNode matchIdNode = xmlNode.SelectSingleNode("matchId");
     
     if (matchIdNode != null)
     {
         if (matchIdNode.Attributes["href"] != null || matchIdNode.Attributes["id"] != null) 
         {
             if (matchIdNode.Attributes["id"] != null) 
             {
                 matchIdIDRef_ = matchIdNode.Attributes["id"].Value;
                 MatchId ob = new MatchId(matchIdNode);
                 IDManager.SetID(matchIdIDRef_, ob);
             }
             else if (matchIdNode.Attributes["href"] != null)
             {
                 matchIdIDRef_ = matchIdNode.Attributes["href"].Value;
             }
             else
             {
                 matchId_ = new MatchId(matchIdNode);
             }
         }
         else
         {
             matchId_ = new MatchId(matchIdNode);
         }
     }
     
 
     XmlNodeList differenceNodeList = xmlNode.SelectNodes("difference");
     
     if (differenceNodeList != null)
     {
         this.difference_ = new List<TradeDifference>();
         foreach (XmlNode item in differenceNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     differenceIDRef_ = item.Attributes["id"].Value;
                     difference_.Add(new TradeDifference(item));
                     IDManager.SetID(differenceIDRef_, difference_[difference_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     differenceIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 difference_.Add(new TradeDifference(item));
                 }
             }
             else
             {
                 difference_.Add(new TradeDifference(item));
             }
         }
     }
     
 
     XmlNode matchScoreNode = xmlNode.SelectSingleNode("matchScore");
     
     if (matchScoreNode != null)
     {
         if (matchScoreNode.Attributes["href"] != null || matchScoreNode.Attributes["id"] != null) 
         {
             if (matchScoreNode.Attributes["id"] != null) 
             {
                 matchScoreIDRef_ = matchScoreNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(matchScoreNode);
                 IDManager.SetID(matchScoreIDRef_, ob);
             }
             else if (matchScoreNode.Attributes["href"] != null)
             {
                 matchScoreIDRef_ = matchScoreNode.Attributes["href"].Value;
             }
             else
             {
                 matchScore_ = new XsdTypeDecimal(matchScoreNode);
             }
         }
         else
         {
             matchScore_ = new XsdTypeDecimal(matchScoreNode);
         }
     }
     
 
 }
 public ConsentRefused(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");
     if (originatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in originatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 originatingEventIDRef = item.Attributes["id"].Name;
                 OriginatingEvent ob = OriginatingEvent();
                 IDManager.SetID(originatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 originatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 originatingEvent = new OriginatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
     if (tradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(tradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 trade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");
     if (amendmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in amendmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 amendmentIDRef = item.Attributes["id"].Name;
                 TradeAmendmentContent ob = TradeAmendmentContent();
                 IDManager.SetID(amendmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 amendmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 amendment = new TradeAmendmentContent(item);
             }
         }
     }
     
 
     XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");
     if (increaseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in increaseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 increaseIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(increaseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 increaseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 increase = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");
     if (terminatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminatingEventIDRef = item.Attributes["id"].Name;
                 TerminatingEvent ob = TerminatingEvent();
                 IDManager.SetID(terminatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminatingEvent = new TerminatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");
     if (terminationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(terminationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 termination = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");
     if (novationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationIDRef = item.Attributes["id"].Name;
                 TradeNovationContent ob = TradeNovationContent();
                 IDManager.SetID(novationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novation = new TradeNovationContent(item);
             }
         }
     }
     
 
     XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");
     if (optionExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExerciseIDRef = item.Attributes["id"].Name;
                 OptionExercise ob = OptionExercise();
                 IDManager.SetID(optionExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionExercise = new OptionExercise(item);
             }
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     foreach (XmlNode item in optionExpiryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExpiryIDRef = item.Attributes["id"].Name;
                 List<OptionExpiry> ob = new List<OptionExpiry>();
                 ob.Add(new OptionExpiry(item));
                 IDManager.SetID(optionExpiryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExpiryIDRef = item.Attributes["href"].Name;
             }
             else
             {
             optionExpiry.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");
     if (deClearNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deClearNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deClearIDRef = item.Attributes["id"].Name;
                 DeClear ob = DeClear();
                 IDManager.SetID(deClearIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deClearIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deClear = new DeClear(item);
             }
         }
     }
     
 
     XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");
     if (withdrawalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in withdrawalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 withdrawalIDRef = item.Attributes["id"].Name;
                 Withdrawal ob = Withdrawal();
                 IDManager.SetID(withdrawalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 withdrawalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 withdrawal = new Withdrawal(item);
             }
         }
     }
     
 
     XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");
     if (additionalEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in additionalEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 additionalEventIDRef = item.Attributes["id"].Name;
                 AdditionalEvent ob = AdditionalEvent();
                 IDManager.SetID(additionalEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 additionalEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 additionalEvent = new AdditionalEvent(item);
             }
         }
     }
     
 
     XmlNodeList tradeReferenceInformationNodeList = xmlNode.SelectNodes("tradeReferenceInformation");
     if (tradeReferenceInformationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tradeReferenceInformationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeReferenceInformationIDRef = item.Attributes["id"].Name;
                 TradeReferenceInformation ob = TradeReferenceInformation();
                 IDManager.SetID(tradeReferenceInformationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeReferenceInformationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 tradeReferenceInformation = new TradeReferenceInformation(item);
             }
         }
     }
     
 
     XmlNodeList partyNodeList = xmlNode.SelectNodes("party");
     
     foreach (XmlNode item in partyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyIDRef = item.Attributes["id"].Name;
                 List<Party> ob = new List<Party>();
                 ob.Add(new Party(item));
                 IDManager.SetID(partyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyIDRef = item.Attributes["href"].Name;
             }
             else
             {
             party.Add(new Party(item));
             }
         }
     }
     
 
     XmlNodeList accountNodeList = xmlNode.SelectNodes("account");
     
     foreach (XmlNode item in accountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 accountIDRef = item.Attributes["id"].Name;
                 List<Account> ob = new List<Account>();
                 ob.Add(new Account(item));
                 IDManager.SetID(accountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 accountIDRef = item.Attributes["href"].Name;
             }
             else
             {
             account.Add(new Account(item));
             }
         }
     }
     
 
     XmlNodeList reasonNodeList = xmlNode.SelectNodes("reason");
     
     foreach (XmlNode item in reasonNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 reasonIDRef = item.Attributes["id"].Name;
                 List<Reason> ob = new List<Reason>();
                 ob.Add(new Reason(item));
                 IDManager.SetID(reasonIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 reasonIDRef = item.Attributes["href"].Name;
             }
             else
             {
             reason.Add(new Reason(item));
             }
         }
     }
     
 
 }
 public ExecutionAdvice(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList productTypeNodeList = xmlNode.SelectNodes("productType");
     if (productTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in productTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 productTypeIDRef = item.Attributes["id"].Name;
                 ProductType ob = ProductType();
                 IDManager.SetID(productTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 productTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 productType = new ProductType(item);
             }
         }
     }
     
 
     XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");
     if (originatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in originatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 originatingEventIDRef = item.Attributes["id"].Name;
                 OriginatingEvent ob = OriginatingEvent();
                 IDManager.SetID(originatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 originatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 originatingEvent = new OriginatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
     if (tradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(tradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 trade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");
     if (amendmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in amendmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 amendmentIDRef = item.Attributes["id"].Name;
                 TradeAmendmentContent ob = TradeAmendmentContent();
                 IDManager.SetID(amendmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 amendmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 amendment = new TradeAmendmentContent(item);
             }
         }
     }
     
 
     XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");
     if (increaseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in increaseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 increaseIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(increaseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 increaseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 increase = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");
     if (terminatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminatingEventIDRef = item.Attributes["id"].Name;
                 TerminatingEvent ob = TerminatingEvent();
                 IDManager.SetID(terminatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminatingEvent = new TerminatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");
     if (terminationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(terminationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 termination = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");
     if (novationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationIDRef = item.Attributes["id"].Name;
                 TradeNovationContent ob = TradeNovationContent();
                 IDManager.SetID(novationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novation = new TradeNovationContent(item);
             }
         }
     }
     
 
     XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");
     if (optionExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExerciseIDRef = item.Attributes["id"].Name;
                 OptionExercise ob = OptionExercise();
                 IDManager.SetID(optionExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionExercise = new OptionExercise(item);
             }
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     foreach (XmlNode item in optionExpiryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExpiryIDRef = item.Attributes["id"].Name;
                 List<OptionExpiry> ob = new List<OptionExpiry>();
                 ob.Add(new OptionExpiry(item));
                 IDManager.SetID(optionExpiryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExpiryIDRef = item.Attributes["href"].Name;
             }
             else
             {
             optionExpiry.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");
     if (deClearNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deClearNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deClearIDRef = item.Attributes["id"].Name;
                 DeClear ob = DeClear();
                 IDManager.SetID(deClearIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deClearIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deClear = new DeClear(item);
             }
         }
     }
     
 
     XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");
     if (withdrawalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in withdrawalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 withdrawalIDRef = item.Attributes["id"].Name;
                 Withdrawal ob = Withdrawal();
                 IDManager.SetID(withdrawalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 withdrawalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 withdrawal = new Withdrawal(item);
             }
         }
     }
     
 
     XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");
     if (additionalEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in additionalEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 additionalEventIDRef = item.Attributes["id"].Name;
                 AdditionalEvent ob = AdditionalEvent();
                 IDManager.SetID(additionalEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 additionalEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 additionalEvent = new AdditionalEvent(item);
             }
         }
     }
     
 
     XmlNodeList quoteNodeList = xmlNode.SelectNodes("quote");
     
     foreach (XmlNode item in quoteNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quoteIDRef = item.Attributes["id"].Name;
                 List<BasicQuotation> ob = new List<BasicQuotation>();
                 ob.Add(new BasicQuotation(item));
                 IDManager.SetID(quoteIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quoteIDRef = item.Attributes["href"].Name;
             }
             else
             {
             quote.Add(new BasicQuotation(item));
             }
         }
     }
     
 
     XmlNodeList paymentDetailsNodeList = xmlNode.SelectNodes("paymentDetails");
     
     foreach (XmlNode item in paymentDetailsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentDetailsIDRef = item.Attributes["id"].Name;
                 List<PaymentDetails> ob = new List<PaymentDetails>();
                 ob.Add(new PaymentDetails(item));
                 IDManager.SetID(paymentDetailsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentDetailsIDRef = item.Attributes["href"].Name;
             }
             else
             {
             paymentDetails.Add(new PaymentDetails(item));
             }
         }
     }
     
 
     XmlNodeList partyNodeList = xmlNode.SelectNodes("party");
     
     foreach (XmlNode item in partyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyIDRef = item.Attributes["id"].Name;
                 List<Party> ob = new List<Party>();
                 ob.Add(new Party(item));
                 IDManager.SetID(partyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyIDRef = item.Attributes["href"].Name;
             }
             else
             {
             party.Add(new Party(item));
             }
         }
     }
     
 
     XmlNodeList accountNodeList = xmlNode.SelectNodes("account");
     
     foreach (XmlNode item in accountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 accountIDRef = item.Attributes["id"].Name;
                 List<Account> ob = new List<Account>();
                 ob.Add(new Account(item));
                 IDManager.SetID(accountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 accountIDRef = item.Attributes["href"].Name;
             }
             else
             {
             account.Add(new Account(item));
             }
         }
     }
     
 
 }
 public ClearingRefused(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode originatingEventNode = xmlNode.SelectSingleNode("originatingEvent");
     
     if (originatingEventNode != null)
     {
         if (originatingEventNode.Attributes["href"] != null || originatingEventNode.Attributes["id"] != null) 
         {
             if (originatingEventNode.Attributes["id"] != null) 
             {
                 originatingEventIDRef_ = originatingEventNode.Attributes["id"].Value;
                 OriginatingEvent ob = new OriginatingEvent(originatingEventNode);
                 IDManager.SetID(originatingEventIDRef_, ob);
             }
             else if (originatingEventNode.Attributes["href"] != null)
             {
                 originatingEventIDRef_ = originatingEventNode.Attributes["href"].Value;
             }
             else
             {
                 originatingEvent_ = new OriginatingEvent(originatingEventNode);
             }
         }
         else
         {
             originatingEvent_ = new OriginatingEvent(originatingEventNode);
         }
     }
     
 
     XmlNode tradeNode = xmlNode.SelectSingleNode("trade");
     
     if (tradeNode != null)
     {
         if (tradeNode.Attributes["href"] != null || tradeNode.Attributes["id"] != null) 
         {
             if (tradeNode.Attributes["id"] != null) 
             {
                 tradeIDRef_ = tradeNode.Attributes["id"].Value;
                 Trade ob = new Trade(tradeNode);
                 IDManager.SetID(tradeIDRef_, ob);
             }
             else if (tradeNode.Attributes["href"] != null)
             {
                 tradeIDRef_ = tradeNode.Attributes["href"].Value;
             }
             else
             {
                 trade_ = new Trade(tradeNode);
             }
         }
         else
         {
             trade_ = new Trade(tradeNode);
         }
     }
     
 
     XmlNode amendmentNode = xmlNode.SelectSingleNode("amendment");
     
     if (amendmentNode != null)
     {
         if (amendmentNode.Attributes["href"] != null || amendmentNode.Attributes["id"] != null) 
         {
             if (amendmentNode.Attributes["id"] != null) 
             {
                 amendmentIDRef_ = amendmentNode.Attributes["id"].Value;
                 TradeAmendmentContent ob = new TradeAmendmentContent(amendmentNode);
                 IDManager.SetID(amendmentIDRef_, ob);
             }
             else if (amendmentNode.Attributes["href"] != null)
             {
                 amendmentIDRef_ = amendmentNode.Attributes["href"].Value;
             }
             else
             {
                 amendment_ = new TradeAmendmentContent(amendmentNode);
             }
         }
         else
         {
             amendment_ = new TradeAmendmentContent(amendmentNode);
         }
     }
     
 
     XmlNode increaseNode = xmlNode.SelectSingleNode("increase");
     
     if (increaseNode != null)
     {
         if (increaseNode.Attributes["href"] != null || increaseNode.Attributes["id"] != null) 
         {
             if (increaseNode.Attributes["id"] != null) 
             {
                 increaseIDRef_ = increaseNode.Attributes["id"].Value;
                 TradeNotionalChange ob = new TradeNotionalChange(increaseNode);
                 IDManager.SetID(increaseIDRef_, ob);
             }
             else if (increaseNode.Attributes["href"] != null)
             {
                 increaseIDRef_ = increaseNode.Attributes["href"].Value;
             }
             else
             {
                 increase_ = new TradeNotionalChange(increaseNode);
             }
         }
         else
         {
             increase_ = new TradeNotionalChange(increaseNode);
         }
     }
     
 
     XmlNode terminatingEventNode = xmlNode.SelectSingleNode("terminatingEvent");
     
     if (terminatingEventNode != null)
     {
         if (terminatingEventNode.Attributes["href"] != null || terminatingEventNode.Attributes["id"] != null) 
         {
             if (terminatingEventNode.Attributes["id"] != null) 
             {
                 terminatingEventIDRef_ = terminatingEventNode.Attributes["id"].Value;
                 TerminatingEvent ob = new TerminatingEvent(terminatingEventNode);
                 IDManager.SetID(terminatingEventIDRef_, ob);
             }
             else if (terminatingEventNode.Attributes["href"] != null)
             {
                 terminatingEventIDRef_ = terminatingEventNode.Attributes["href"].Value;
             }
             else
             {
                 terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
             }
         }
         else
         {
             terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
         }
     }
     
 
     XmlNode terminationNode = xmlNode.SelectSingleNode("termination");
     
     if (terminationNode != null)
     {
         if (terminationNode.Attributes["href"] != null || terminationNode.Attributes["id"] != null) 
         {
             if (terminationNode.Attributes["id"] != null) 
             {
                 terminationIDRef_ = terminationNode.Attributes["id"].Value;
                 TradeNotionalChange ob = new TradeNotionalChange(terminationNode);
                 IDManager.SetID(terminationIDRef_, ob);
             }
             else if (terminationNode.Attributes["href"] != null)
             {
                 terminationIDRef_ = terminationNode.Attributes["href"].Value;
             }
             else
             {
                 termination_ = new TradeNotionalChange(terminationNode);
             }
         }
         else
         {
             termination_ = new TradeNotionalChange(terminationNode);
         }
     }
     
 
     XmlNode novationNode = xmlNode.SelectSingleNode("novation");
     
     if (novationNode != null)
     {
         if (novationNode.Attributes["href"] != null || novationNode.Attributes["id"] != null) 
         {
             if (novationNode.Attributes["id"] != null) 
             {
                 novationIDRef_ = novationNode.Attributes["id"].Value;
                 TradeNovationContent ob = new TradeNovationContent(novationNode);
                 IDManager.SetID(novationIDRef_, ob);
             }
             else if (novationNode.Attributes["href"] != null)
             {
                 novationIDRef_ = novationNode.Attributes["href"].Value;
             }
             else
             {
                 novation_ = new TradeNovationContent(novationNode);
             }
         }
         else
         {
             novation_ = new TradeNovationContent(novationNode);
         }
     }
     
 
     XmlNode optionExerciseNode = xmlNode.SelectSingleNode("optionExercise");
     
     if (optionExerciseNode != null)
     {
         if (optionExerciseNode.Attributes["href"] != null || optionExerciseNode.Attributes["id"] != null) 
         {
             if (optionExerciseNode.Attributes["id"] != null) 
             {
                 optionExerciseIDRef_ = optionExerciseNode.Attributes["id"].Value;
                 OptionExercise ob = new OptionExercise(optionExerciseNode);
                 IDManager.SetID(optionExerciseIDRef_, ob);
             }
             else if (optionExerciseNode.Attributes["href"] != null)
             {
                 optionExerciseIDRef_ = optionExerciseNode.Attributes["href"].Value;
             }
             else
             {
                 optionExercise_ = new OptionExercise(optionExerciseNode);
             }
         }
         else
         {
             optionExercise_ = new OptionExercise(optionExerciseNode);
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     if (optionExpiryNodeList != null)
     {
         this.optionExpiry_ = new List<OptionExpiry>();
         foreach (XmlNode item in optionExpiryNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     optionExpiryIDRef_ = item.Attributes["id"].Value;
                     optionExpiry_.Add(new OptionExpiry(item));
                     IDManager.SetID(optionExpiryIDRef_, optionExpiry_[optionExpiry_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     optionExpiryIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 optionExpiry_.Add(new OptionExpiry(item));
                 }
             }
             else
             {
                 optionExpiry_.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNode deClearNode = xmlNode.SelectSingleNode("deClear");
     
     if (deClearNode != null)
     {
         if (deClearNode.Attributes["href"] != null || deClearNode.Attributes["id"] != null) 
         {
             if (deClearNode.Attributes["id"] != null) 
             {
                 deClearIDRef_ = deClearNode.Attributes["id"].Value;
                 DeClear ob = new DeClear(deClearNode);
                 IDManager.SetID(deClearIDRef_, ob);
             }
             else if (deClearNode.Attributes["href"] != null)
             {
                 deClearIDRef_ = deClearNode.Attributes["href"].Value;
             }
             else
             {
                 deClear_ = new DeClear(deClearNode);
             }
         }
         else
         {
             deClear_ = new DeClear(deClearNode);
         }
     }
     
 
     XmlNode withdrawalNode = xmlNode.SelectSingleNode("withdrawal");
     
     if (withdrawalNode != null)
     {
         if (withdrawalNode.Attributes["href"] != null || withdrawalNode.Attributes["id"] != null) 
         {
             if (withdrawalNode.Attributes["id"] != null) 
             {
                 withdrawalIDRef_ = withdrawalNode.Attributes["id"].Value;
                 Withdrawal ob = new Withdrawal(withdrawalNode);
                 IDManager.SetID(withdrawalIDRef_, ob);
             }
             else if (withdrawalNode.Attributes["href"] != null)
             {
                 withdrawalIDRef_ = withdrawalNode.Attributes["href"].Value;
             }
             else
             {
                 withdrawal_ = new Withdrawal(withdrawalNode);
             }
         }
         else
         {
             withdrawal_ = new Withdrawal(withdrawalNode);
         }
     }
     
 
     XmlNode additionalEventNode = xmlNode.SelectSingleNode("additionalEvent");
     
     if (additionalEventNode != null)
     {
         if (additionalEventNode.Attributes["href"] != null || additionalEventNode.Attributes["id"] != null) 
         {
             if (additionalEventNode.Attributes["id"] != null) 
             {
                 additionalEventIDRef_ = additionalEventNode.Attributes["id"].Value;
                 AdditionalEvent ob = new AdditionalEvent(additionalEventNode);
                 IDManager.SetID(additionalEventIDRef_, ob);
             }
             else if (additionalEventNode.Attributes["href"] != null)
             {
                 additionalEventIDRef_ = additionalEventNode.Attributes["href"].Value;
             }
             else
             {
                 additionalEvent_ = new AdditionalEvent(additionalEventNode);
             }
         }
         else
         {
             additionalEvent_ = new AdditionalEvent(additionalEventNode);
         }
     }
     
 
     XmlNodeList quoteNodeList = xmlNode.SelectNodes("quote");
     
     if (quoteNodeList != null)
     {
         this.quote_ = new List<BasicQuotation>();
         foreach (XmlNode item in quoteNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     quoteIDRef_ = item.Attributes["id"].Value;
                     quote_.Add(new BasicQuotation(item));
                     IDManager.SetID(quoteIDRef_, quote_[quote_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     quoteIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 quote_.Add(new BasicQuotation(item));
                 }
             }
             else
             {
                 quote_.Add(new BasicQuotation(item));
             }
         }
     }
     
 
     XmlNodeList partyNodeList = xmlNode.SelectNodes("party");
     
     if (partyNodeList != null)
     {
         this.party_ = new List<Party>();
         foreach (XmlNode item in partyNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     partyIDRef_ = item.Attributes["id"].Value;
                     party_.Add(new Party(item));
                     IDManager.SetID(partyIDRef_, party_[party_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     partyIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 party_.Add(new Party(item));
                 }
             }
             else
             {
                 party_.Add(new Party(item));
             }
         }
     }
     
 
     XmlNodeList accountNodeList = xmlNode.SelectNodes("account");
     
     if (accountNodeList != null)
     {
         this.account_ = new List<Account>();
         foreach (XmlNode item in accountNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     accountIDRef_ = item.Attributes["id"].Value;
                     account_.Add(new Account(item));
                     IDManager.SetID(accountIDRef_, account_[account_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     accountIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 account_.Add(new Account(item));
                 }
             }
             else
             {
                 account_.Add(new Account(item));
             }
         }
     }
     
 
     XmlNodeList reasonNodeList = xmlNode.SelectNodes("reason");
     
     if (reasonNodeList != null)
     {
         this.reason_ = new List<Reason>();
         foreach (XmlNode item in reasonNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     reasonIDRef_ = item.Attributes["id"].Value;
                     reason_.Add(new Reason(item));
                     IDManager.SetID(reasonIDRef_, reason_[reason_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     reasonIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 reason_.Add(new Reason(item));
                 }
             }
             else
             {
                 reason_.Add(new Reason(item));
             }
         }
     }
     
 
 }
예제 #5
0
        public RequestExecutionRetracted(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode originatingEventNode = xmlNode.SelectSingleNode("originatingEvent");

            if (originatingEventNode != null)
            {
                if (originatingEventNode.Attributes["href"] != null || originatingEventNode.Attributes["id"] != null)
                {
                    if (originatingEventNode.Attributes["id"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["id"].Value;
                        OriginatingEvent ob = new OriginatingEvent(originatingEventNode);
                        IDManager.SetID(originatingEventIDRef_, ob);
                    }
                    else if (originatingEventNode.Attributes["href"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        originatingEvent_ = new OriginatingEvent(originatingEventNode);
                    }
                }
                else
                {
                    originatingEvent_ = new OriginatingEvent(originatingEventNode);
                }
            }


            XmlNode tradeNode = xmlNode.SelectSingleNode("trade");

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


            XmlNode amendmentNode = xmlNode.SelectSingleNode("amendment");

            if (amendmentNode != null)
            {
                if (amendmentNode.Attributes["href"] != null || amendmentNode.Attributes["id"] != null)
                {
                    if (amendmentNode.Attributes["id"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["id"].Value;
                        TradeAmendmentContent ob = new TradeAmendmentContent(amendmentNode);
                        IDManager.SetID(amendmentIDRef_, ob);
                    }
                    else if (amendmentNode.Attributes["href"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        amendment_ = new TradeAmendmentContent(amendmentNode);
                    }
                }
                else
                {
                    amendment_ = new TradeAmendmentContent(amendmentNode);
                }
            }


            XmlNode increaseNode = xmlNode.SelectSingleNode("increase");

            if (increaseNode != null)
            {
                if (increaseNode.Attributes["href"] != null || increaseNode.Attributes["id"] != null)
                {
                    if (increaseNode.Attributes["id"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(increaseNode);
                        IDManager.SetID(increaseIDRef_, ob);
                    }
                    else if (increaseNode.Attributes["href"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        increase_ = new TradeNotionalChange(increaseNode);
                    }
                }
                else
                {
                    increase_ = new TradeNotionalChange(increaseNode);
                }
            }


            XmlNode terminatingEventNode = xmlNode.SelectSingleNode("terminatingEvent");

            if (terminatingEventNode != null)
            {
                if (terminatingEventNode.Attributes["href"] != null || terminatingEventNode.Attributes["id"] != null)
                {
                    if (terminatingEventNode.Attributes["id"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["id"].Value;
                        TerminatingEvent ob = new TerminatingEvent(terminatingEventNode);
                        IDManager.SetID(terminatingEventIDRef_, ob);
                    }
                    else if (terminatingEventNode.Attributes["href"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                    }
                }
                else
                {
                    terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                }
            }


            XmlNode terminationNode = xmlNode.SelectSingleNode("termination");

            if (terminationNode != null)
            {
                if (terminationNode.Attributes["href"] != null || terminationNode.Attributes["id"] != null)
                {
                    if (terminationNode.Attributes["id"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(terminationNode);
                        IDManager.SetID(terminationIDRef_, ob);
                    }
                    else if (terminationNode.Attributes["href"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        termination_ = new TradeNotionalChange(terminationNode);
                    }
                }
                else
                {
                    termination_ = new TradeNotionalChange(terminationNode);
                }
            }


            XmlNode novationNode = xmlNode.SelectSingleNode("novation");

            if (novationNode != null)
            {
                if (novationNode.Attributes["href"] != null || novationNode.Attributes["id"] != null)
                {
                    if (novationNode.Attributes["id"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["id"].Value;
                        TradeNovationContent ob = new TradeNovationContent(novationNode);
                        IDManager.SetID(novationIDRef_, ob);
                    }
                    else if (novationNode.Attributes["href"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        novation_ = new TradeNovationContent(novationNode);
                    }
                }
                else
                {
                    novation_ = new TradeNovationContent(novationNode);
                }
            }


            XmlNode optionExerciseNode = xmlNode.SelectSingleNode("optionExercise");

            if (optionExerciseNode != null)
            {
                if (optionExerciseNode.Attributes["href"] != null || optionExerciseNode.Attributes["id"] != null)
                {
                    if (optionExerciseNode.Attributes["id"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["id"].Value;
                        OptionExercise ob = new OptionExercise(optionExerciseNode);
                        IDManager.SetID(optionExerciseIDRef_, ob);
                    }
                    else if (optionExerciseNode.Attributes["href"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionExercise_ = new OptionExercise(optionExerciseNode);
                    }
                }
                else
                {
                    optionExercise_ = new OptionExercise(optionExerciseNode);
                }
            }


            XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");

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


            XmlNode deClearNode = xmlNode.SelectSingleNode("deClear");

            if (deClearNode != null)
            {
                if (deClearNode.Attributes["href"] != null || deClearNode.Attributes["id"] != null)
                {
                    if (deClearNode.Attributes["id"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["id"].Value;
                        DeClear ob = new DeClear(deClearNode);
                        IDManager.SetID(deClearIDRef_, ob);
                    }
                    else if (deClearNode.Attributes["href"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deClear_ = new DeClear(deClearNode);
                    }
                }
                else
                {
                    deClear_ = new DeClear(deClearNode);
                }
            }


            XmlNode withdrawalNode = xmlNode.SelectSingleNode("withdrawal");

            if (withdrawalNode != null)
            {
                if (withdrawalNode.Attributes["href"] != null || withdrawalNode.Attributes["id"] != null)
                {
                    if (withdrawalNode.Attributes["id"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["id"].Value;
                        Withdrawal ob = new Withdrawal(withdrawalNode);
                        IDManager.SetID(withdrawalIDRef_, ob);
                    }
                    else if (withdrawalNode.Attributes["href"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        withdrawal_ = new Withdrawal(withdrawalNode);
                    }
                }
                else
                {
                    withdrawal_ = new Withdrawal(withdrawalNode);
                }
            }


            XmlNode additionalEventNode = xmlNode.SelectSingleNode("additionalEvent");

            if (additionalEventNode != null)
            {
                if (additionalEventNode.Attributes["href"] != null || additionalEventNode.Attributes["id"] != null)
                {
                    if (additionalEventNode.Attributes["id"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["id"].Value;
                        AdditionalEvent ob = new AdditionalEvent(additionalEventNode);
                        IDManager.SetID(additionalEventIDRef_, ob);
                    }
                    else if (additionalEventNode.Attributes["href"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        additionalEvent_ = new AdditionalEvent(additionalEventNode);
                    }
                }
                else
                {
                    additionalEvent_ = new AdditionalEvent(additionalEventNode);
                }
            }


            XmlNodeList partyNodeList = xmlNode.SelectNodes("party");

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


            XmlNodeList accountNodeList = xmlNode.SelectNodes("account");

            if (accountNodeList != null)
            {
                this.account_ = new List <Account>();
                foreach (XmlNode item in accountNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            accountIDRef_ = item.Attributes["id"].Value;
                            account_.Add(new Account(item));
                            IDManager.SetID(accountIDRef_, account_[account_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            accountIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            account_.Add(new Account(item));
                        }
                    }
                    else
                    {
                        account_.Add(new Account(item));
                    }
                }
            }
        }
예제 #6
0
        public ExecutionAdviceRetracted(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");

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

            foreach (XmlNode item in originatingEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        originatingEventIDRef = item.Attributes["id"].Name;
                        OriginatingEvent ob = OriginatingEvent();
                        IDManager.SetID(originatingEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        originatingEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        originatingEvent = new OriginatingEvent(item);
                    }
                }
            }


            XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");

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

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


            XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");

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

            foreach (XmlNode item in amendmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        amendmentIDRef = item.Attributes["id"].Name;
                        TradeAmendmentContent ob = TradeAmendmentContent();
                        IDManager.SetID(amendmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        amendmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        amendment = new TradeAmendmentContent(item);
                    }
                }
            }


            XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");

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

            foreach (XmlNode item in increaseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        increaseIDRef = item.Attributes["id"].Name;
                        TradeNotionalChange ob = TradeNotionalChange();
                        IDManager.SetID(increaseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        increaseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        increase = new TradeNotionalChange(item);
                    }
                }
            }


            XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");

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

            foreach (XmlNode item in terminatingEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminatingEventIDRef = item.Attributes["id"].Name;
                        TerminatingEvent ob = TerminatingEvent();
                        IDManager.SetID(terminatingEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminatingEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        terminatingEvent = new TerminatingEvent(item);
                    }
                }
            }


            XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");

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

            foreach (XmlNode item in terminationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminationIDRef = item.Attributes["id"].Name;
                        TradeNotionalChange ob = TradeNotionalChange();
                        IDManager.SetID(terminationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        termination = new TradeNotionalChange(item);
                    }
                }
            }


            XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");

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

            foreach (XmlNode item in novationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        novationIDRef = item.Attributes["id"].Name;
                        TradeNovationContent ob = TradeNovationContent();
                        IDManager.SetID(novationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        novationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        novation = new TradeNovationContent(item);
                    }
                }
            }


            XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");

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

            foreach (XmlNode item in optionExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionExerciseIDRef = item.Attributes["id"].Name;
                        OptionExercise ob = OptionExercise();
                        IDManager.SetID(optionExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionExercise = new OptionExercise(item);
                    }
                }
            }


            XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");

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


            XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");

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

            foreach (XmlNode item in deClearNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deClearIDRef = item.Attributes["id"].Name;
                        DeClear ob = DeClear();
                        IDManager.SetID(deClearIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deClearIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deClear = new DeClear(item);
                    }
                }
            }


            XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");

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

            foreach (XmlNode item in withdrawalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        withdrawalIDRef = item.Attributes["id"].Name;
                        Withdrawal ob = Withdrawal();
                        IDManager.SetID(withdrawalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        withdrawalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        withdrawal = new Withdrawal(item);
                    }
                }
            }


            XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");

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

            foreach (XmlNode item in additionalEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        additionalEventIDRef = item.Attributes["id"].Name;
                        AdditionalEvent ob = AdditionalEvent();
                        IDManager.SetID(additionalEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        additionalEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        additionalEvent = new AdditionalEvent(item);
                    }
                }
            }


            XmlNodeList paymentDetailsNodeList = xmlNode.SelectNodes("paymentDetails");

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


            XmlNodeList partyNodeList = xmlNode.SelectNodes("party");

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


            XmlNodeList accountNodeList = xmlNode.SelectNodes("account");

            foreach (XmlNode item in accountNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        accountIDRef = item.Attributes["id"].Name;
                        List <Account> ob = new List <Account>();
                        ob.Add(new Account(item));
                        IDManager.SetID(accountIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        accountIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        account.Add(new Account(item));
                    }
                }
            }
        }
 public EventProposedMatch(XmlNode xmlNode)
 {
     XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");
     if (originatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in originatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 originatingEventIDRef = item.Attributes["id"].Name;
                 OriginatingEvent ob = OriginatingEvent();
                 IDManager.SetID(originatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 originatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 originatingEvent = new OriginatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
     if (tradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(tradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 trade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");
     if (amendmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in amendmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 amendmentIDRef = item.Attributes["id"].Name;
                 TradeAmendmentContent ob = TradeAmendmentContent();
                 IDManager.SetID(amendmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 amendmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 amendment = new TradeAmendmentContent(item);
             }
         }
     }
     
 
     XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");
     if (increaseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in increaseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 increaseIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(increaseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 increaseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 increase = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");
     if (terminatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminatingEventIDRef = item.Attributes["id"].Name;
                 TerminatingEvent ob = TerminatingEvent();
                 IDManager.SetID(terminatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminatingEvent = new TerminatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");
     if (terminationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(terminationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 termination = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");
     if (novationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationIDRef = item.Attributes["id"].Name;
                 TradeNovationContent ob = TradeNovationContent();
                 IDManager.SetID(novationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novation = new TradeNovationContent(item);
             }
         }
     }
     
 
     XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");
     if (optionExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExerciseIDRef = item.Attributes["id"].Name;
                 OptionExercise ob = OptionExercise();
                 IDManager.SetID(optionExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionExercise = new OptionExercise(item);
             }
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     foreach (XmlNode item in optionExpiryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExpiryIDRef = item.Attributes["id"].Name;
                 List<OptionExpiry> ob = new List<OptionExpiry>();
                 ob.Add(new OptionExpiry(item));
                 IDManager.SetID(optionExpiryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExpiryIDRef = item.Attributes["href"].Name;
             }
             else
             {
             optionExpiry.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");
     if (deClearNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deClearNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deClearIDRef = item.Attributes["id"].Name;
                 DeClear ob = DeClear();
                 IDManager.SetID(deClearIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deClearIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deClear = new DeClear(item);
             }
         }
     }
     
 
     XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");
     if (withdrawalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in withdrawalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 withdrawalIDRef = item.Attributes["id"].Name;
                 Withdrawal ob = Withdrawal();
                 IDManager.SetID(withdrawalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 withdrawalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 withdrawal = new Withdrawal(item);
             }
         }
     }
     
 
     XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");
     if (additionalEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in additionalEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 additionalEventIDRef = item.Attributes["id"].Name;
                 AdditionalEvent ob = AdditionalEvent();
                 IDManager.SetID(additionalEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 additionalEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 additionalEvent = new AdditionalEvent(item);
             }
         }
     }
     
 
     XmlNodeList matchIdNodeList = xmlNode.SelectNodes("matchId");
     if (matchIdNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in matchIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 matchIdIDRef = item.Attributes["id"].Name;
                 MatchId ob = MatchId();
                 IDManager.SetID(matchIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 matchIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 matchId = new MatchId(item);
             }
         }
     }
     
 
     XmlNodeList differenceNodeList = xmlNode.SelectNodes("difference");
     
     foreach (XmlNode item in differenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 differenceIDRef = item.Attributes["id"].Name;
                 List<TradeDifference> ob = new List<TradeDifference>();
                 ob.Add(new TradeDifference(item));
                 IDManager.SetID(differenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 differenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
             difference.Add(new TradeDifference(item));
             }
         }
     }
     
 
     XmlNodeList matchScoreNodeList = xmlNode.SelectNodes("matchScore");
     if (matchScoreNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in matchScoreNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 matchScoreIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(matchScoreIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 matchScoreIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 matchScore = new XsdTypeDecimal(item);
             }
         }
     }
     
 
 }
 public ClearingConfirmed(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList compressionActivityNodeList = xmlNode.SelectNodes("compressionActivity");
     if (compressionActivityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in compressionActivityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 compressionActivityIDRef = item.Attributes["id"].Name;
                 CompressionActivity ob = CompressionActivity();
                 IDManager.SetID(compressionActivityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 compressionActivityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 compressionActivity = new CompressionActivity(item);
             }
         }
     }
     
 
     XmlNodeList portfolioReferenceNodeList = xmlNode.SelectNodes("portfolioReference");
     if (portfolioReferenceNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in portfolioReferenceNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 portfolioReferenceIDRef = item.Attributes["id"].Name;
                 PortfolioReference ob = PortfolioReference();
                 IDManager.SetID(portfolioReferenceIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 portfolioReferenceIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 portfolioReference = new PortfolioReference(item);
             }
         }
     }
     
 
     XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");
     if (originatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in originatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 originatingEventIDRef = item.Attributes["id"].Name;
                 OriginatingEvent ob = OriginatingEvent();
                 IDManager.SetID(originatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 originatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 originatingEvent = new OriginatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
     if (tradeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in tradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIDRef = item.Attributes["id"].Name;
                 Trade ob = Trade();
                 IDManager.SetID(tradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 trade = new Trade(item);
             }
         }
     }
     
 
     XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");
     if (amendmentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in amendmentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 amendmentIDRef = item.Attributes["id"].Name;
                 TradeAmendmentContent ob = TradeAmendmentContent();
                 IDManager.SetID(amendmentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 amendmentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 amendment = new TradeAmendmentContent(item);
             }
         }
     }
     
 
     XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");
     if (increaseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in increaseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 increaseIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(increaseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 increaseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 increase = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");
     if (terminatingEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminatingEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminatingEventIDRef = item.Attributes["id"].Name;
                 TerminatingEvent ob = TerminatingEvent();
                 IDManager.SetID(terminatingEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminatingEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 terminatingEvent = new TerminatingEvent(item);
             }
         }
     }
     
 
     XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");
     if (terminationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in terminationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 terminationIDRef = item.Attributes["id"].Name;
                 TradeNotionalChange ob = TradeNotionalChange();
                 IDManager.SetID(terminationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 terminationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 termination = new TradeNotionalChange(item);
             }
         }
     }
     
 
     XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");
     if (novationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in novationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 novationIDRef = item.Attributes["id"].Name;
                 TradeNovationContent ob = TradeNovationContent();
                 IDManager.SetID(novationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 novationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 novation = new TradeNovationContent(item);
             }
         }
     }
     
 
     XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");
     if (optionExerciseNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in optionExerciseNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExerciseIDRef = item.Attributes["id"].Name;
                 OptionExercise ob = OptionExercise();
                 IDManager.SetID(optionExerciseIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExerciseIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 optionExercise = new OptionExercise(item);
             }
         }
     }
     
 
     XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");
     
     foreach (XmlNode item in optionExpiryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 optionExpiryIDRef = item.Attributes["id"].Name;
                 List<OptionExpiry> ob = new List<OptionExpiry>();
                 ob.Add(new OptionExpiry(item));
                 IDManager.SetID(optionExpiryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 optionExpiryIDRef = item.Attributes["href"].Name;
             }
             else
             {
             optionExpiry.Add(new OptionExpiry(item));
             }
         }
     }
     
 
     XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");
     if (deClearNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deClearNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deClearIDRef = item.Attributes["id"].Name;
                 DeClear ob = DeClear();
                 IDManager.SetID(deClearIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deClearIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deClear = new DeClear(item);
             }
         }
     }
     
 
     XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");
     if (withdrawalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in withdrawalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 withdrawalIDRef = item.Attributes["id"].Name;
                 Withdrawal ob = Withdrawal();
                 IDManager.SetID(withdrawalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 withdrawalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 withdrawal = new Withdrawal(item);
             }
         }
     }
     
 
     XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");
     if (additionalEventNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in additionalEventNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 additionalEventIDRef = item.Attributes["id"].Name;
                 AdditionalEvent ob = AdditionalEvent();
                 IDManager.SetID(additionalEventIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 additionalEventIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 additionalEvent = new AdditionalEvent(item);
             }
         }
     }
     
 
     XmlNodeList clearingNodeList = xmlNode.SelectNodes("clearing");
     if (clearingNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in clearingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 clearingIDRef = item.Attributes["id"].Name;
                 Clearing ob = Clearing();
                 IDManager.SetID(clearingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 clearingIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 clearing = new Clearing(item);
             }
         }
     }
     
 
     XmlNodeList quoteNodeList = xmlNode.SelectNodes("quote");
     
     foreach (XmlNode item in quoteNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 quoteIDRef = item.Attributes["id"].Name;
                 List<BasicQuotation> ob = new List<BasicQuotation>();
                 ob.Add(new BasicQuotation(item));
                 IDManager.SetID(quoteIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 quoteIDRef = item.Attributes["href"].Name;
             }
             else
             {
             quote.Add(new BasicQuotation(item));
             }
         }
     }
     
 
     XmlNodeList partyNodeList = xmlNode.SelectNodes("party");
     
     foreach (XmlNode item in partyNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyIDRef = item.Attributes["id"].Name;
                 List<Party> ob = new List<Party>();
                 ob.Add(new Party(item));
                 IDManager.SetID(partyIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyIDRef = item.Attributes["href"].Name;
             }
             else
             {
             party.Add(new Party(item));
             }
         }
     }
     
 
     XmlNodeList accountNodeList = xmlNode.SelectNodes("account");
     
     foreach (XmlNode item in accountNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 accountIDRef = item.Attributes["id"].Name;
                 List<Account> ob = new List<Account>();
                 ob.Add(new Account(item));
                 IDManager.SetID(accountIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 accountIDRef = item.Attributes["href"].Name;
             }
             else
             {
             account.Add(new Account(item));
             }
         }
     }
     
 
 }
        public EventProposedMatch(XmlNode xmlNode)
        {
            XmlNode originatingEventNode = xmlNode.SelectSingleNode("originatingEvent");

            if (originatingEventNode != null)
            {
                if (originatingEventNode.Attributes["href"] != null || originatingEventNode.Attributes["id"] != null)
                {
                    if (originatingEventNode.Attributes["id"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["id"].Value;
                        OriginatingEvent ob = new OriginatingEvent(originatingEventNode);
                        IDManager.SetID(originatingEventIDRef_, ob);
                    }
                    else if (originatingEventNode.Attributes["href"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        originatingEvent_ = new OriginatingEvent(originatingEventNode);
                    }
                }
                else
                {
                    originatingEvent_ = new OriginatingEvent(originatingEventNode);
                }
            }


            XmlNode tradeNode = xmlNode.SelectSingleNode("trade");

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


            XmlNode amendmentNode = xmlNode.SelectSingleNode("amendment");

            if (amendmentNode != null)
            {
                if (amendmentNode.Attributes["href"] != null || amendmentNode.Attributes["id"] != null)
                {
                    if (amendmentNode.Attributes["id"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["id"].Value;
                        TradeAmendmentContent ob = new TradeAmendmentContent(amendmentNode);
                        IDManager.SetID(amendmentIDRef_, ob);
                    }
                    else if (amendmentNode.Attributes["href"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        amendment_ = new TradeAmendmentContent(amendmentNode);
                    }
                }
                else
                {
                    amendment_ = new TradeAmendmentContent(amendmentNode);
                }
            }


            XmlNode increaseNode = xmlNode.SelectSingleNode("increase");

            if (increaseNode != null)
            {
                if (increaseNode.Attributes["href"] != null || increaseNode.Attributes["id"] != null)
                {
                    if (increaseNode.Attributes["id"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(increaseNode);
                        IDManager.SetID(increaseIDRef_, ob);
                    }
                    else if (increaseNode.Attributes["href"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        increase_ = new TradeNotionalChange(increaseNode);
                    }
                }
                else
                {
                    increase_ = new TradeNotionalChange(increaseNode);
                }
            }


            XmlNode terminatingEventNode = xmlNode.SelectSingleNode("terminatingEvent");

            if (terminatingEventNode != null)
            {
                if (terminatingEventNode.Attributes["href"] != null || terminatingEventNode.Attributes["id"] != null)
                {
                    if (terminatingEventNode.Attributes["id"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["id"].Value;
                        TerminatingEvent ob = new TerminatingEvent(terminatingEventNode);
                        IDManager.SetID(terminatingEventIDRef_, ob);
                    }
                    else if (terminatingEventNode.Attributes["href"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                    }
                }
                else
                {
                    terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                }
            }


            XmlNode terminationNode = xmlNode.SelectSingleNode("termination");

            if (terminationNode != null)
            {
                if (terminationNode.Attributes["href"] != null || terminationNode.Attributes["id"] != null)
                {
                    if (terminationNode.Attributes["id"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(terminationNode);
                        IDManager.SetID(terminationIDRef_, ob);
                    }
                    else if (terminationNode.Attributes["href"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        termination_ = new TradeNotionalChange(terminationNode);
                    }
                }
                else
                {
                    termination_ = new TradeNotionalChange(terminationNode);
                }
            }


            XmlNode novationNode = xmlNode.SelectSingleNode("novation");

            if (novationNode != null)
            {
                if (novationNode.Attributes["href"] != null || novationNode.Attributes["id"] != null)
                {
                    if (novationNode.Attributes["id"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["id"].Value;
                        TradeNovationContent ob = new TradeNovationContent(novationNode);
                        IDManager.SetID(novationIDRef_, ob);
                    }
                    else if (novationNode.Attributes["href"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        novation_ = new TradeNovationContent(novationNode);
                    }
                }
                else
                {
                    novation_ = new TradeNovationContent(novationNode);
                }
            }


            XmlNode optionExerciseNode = xmlNode.SelectSingleNode("optionExercise");

            if (optionExerciseNode != null)
            {
                if (optionExerciseNode.Attributes["href"] != null || optionExerciseNode.Attributes["id"] != null)
                {
                    if (optionExerciseNode.Attributes["id"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["id"].Value;
                        OptionExercise ob = new OptionExercise(optionExerciseNode);
                        IDManager.SetID(optionExerciseIDRef_, ob);
                    }
                    else if (optionExerciseNode.Attributes["href"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionExercise_ = new OptionExercise(optionExerciseNode);
                    }
                }
                else
                {
                    optionExercise_ = new OptionExercise(optionExerciseNode);
                }
            }


            XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");

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


            XmlNode deClearNode = xmlNode.SelectSingleNode("deClear");

            if (deClearNode != null)
            {
                if (deClearNode.Attributes["href"] != null || deClearNode.Attributes["id"] != null)
                {
                    if (deClearNode.Attributes["id"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["id"].Value;
                        DeClear ob = new DeClear(deClearNode);
                        IDManager.SetID(deClearIDRef_, ob);
                    }
                    else if (deClearNode.Attributes["href"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deClear_ = new DeClear(deClearNode);
                    }
                }
                else
                {
                    deClear_ = new DeClear(deClearNode);
                }
            }


            XmlNode withdrawalNode = xmlNode.SelectSingleNode("withdrawal");

            if (withdrawalNode != null)
            {
                if (withdrawalNode.Attributes["href"] != null || withdrawalNode.Attributes["id"] != null)
                {
                    if (withdrawalNode.Attributes["id"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["id"].Value;
                        Withdrawal ob = new Withdrawal(withdrawalNode);
                        IDManager.SetID(withdrawalIDRef_, ob);
                    }
                    else if (withdrawalNode.Attributes["href"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        withdrawal_ = new Withdrawal(withdrawalNode);
                    }
                }
                else
                {
                    withdrawal_ = new Withdrawal(withdrawalNode);
                }
            }


            XmlNode additionalEventNode = xmlNode.SelectSingleNode("additionalEvent");

            if (additionalEventNode != null)
            {
                if (additionalEventNode.Attributes["href"] != null || additionalEventNode.Attributes["id"] != null)
                {
                    if (additionalEventNode.Attributes["id"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["id"].Value;
                        AdditionalEvent ob = new AdditionalEvent(additionalEventNode);
                        IDManager.SetID(additionalEventIDRef_, ob);
                    }
                    else if (additionalEventNode.Attributes["href"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        additionalEvent_ = new AdditionalEvent(additionalEventNode);
                    }
                }
                else
                {
                    additionalEvent_ = new AdditionalEvent(additionalEventNode);
                }
            }


            XmlNode matchIdNode = xmlNode.SelectSingleNode("matchId");

            if (matchIdNode != null)
            {
                if (matchIdNode.Attributes["href"] != null || matchIdNode.Attributes["id"] != null)
                {
                    if (matchIdNode.Attributes["id"] != null)
                    {
                        matchIdIDRef_ = matchIdNode.Attributes["id"].Value;
                        MatchId ob = new MatchId(matchIdNode);
                        IDManager.SetID(matchIdIDRef_, ob);
                    }
                    else if (matchIdNode.Attributes["href"] != null)
                    {
                        matchIdIDRef_ = matchIdNode.Attributes["href"].Value;
                    }
                    else
                    {
                        matchId_ = new MatchId(matchIdNode);
                    }
                }
                else
                {
                    matchId_ = new MatchId(matchIdNode);
                }
            }


            XmlNodeList differenceNodeList = xmlNode.SelectNodes("difference");

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


            XmlNode matchScoreNode = xmlNode.SelectSingleNode("matchScore");

            if (matchScoreNode != null)
            {
                if (matchScoreNode.Attributes["href"] != null || matchScoreNode.Attributes["id"] != null)
                {
                    if (matchScoreNode.Attributes["id"] != null)
                    {
                        matchScoreIDRef_ = matchScoreNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(matchScoreNode);
                        IDManager.SetID(matchScoreIDRef_, ob);
                    }
                    else if (matchScoreNode.Attributes["href"] != null)
                    {
                        matchScoreIDRef_ = matchScoreNode.Attributes["href"].Value;
                    }
                    else
                    {
                        matchScore_ = new XsdTypeDecimal(matchScoreNode);
                    }
                }
                else
                {
                    matchScore_ = new XsdTypeDecimal(matchScoreNode);
                }
            }
        }
예제 #10
0
        public RequestConsent(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode requestedActionNode = xmlNode.SelectSingleNode("requestedAction");

            if (requestedActionNode != null)
            {
                if (requestedActionNode.Attributes["href"] != null || requestedActionNode.Attributes["id"] != null)
                {
                    if (requestedActionNode.Attributes["id"] != null)
                    {
                        requestedActionIDRef_ = requestedActionNode.Attributes["id"].Value;
                        RequestedAction ob = new RequestedAction(requestedActionNode);
                        IDManager.SetID(requestedActionIDRef_, ob);
                    }
                    else if (requestedActionNode.Attributes["href"] != null)
                    {
                        requestedActionIDRef_ = requestedActionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        requestedAction_ = new RequestedAction(requestedActionNode);
                    }
                }
                else
                {
                    requestedAction_ = new RequestedAction(requestedActionNode);
                }
            }


            XmlNode portfolioReferenceNode = xmlNode.SelectSingleNode("portfolioReference");

            if (portfolioReferenceNode != null)
            {
                if (portfolioReferenceNode.Attributes["href"] != null || portfolioReferenceNode.Attributes["id"] != null)
                {
                    if (portfolioReferenceNode.Attributes["id"] != null)
                    {
                        portfolioReferenceIDRef_ = portfolioReferenceNode.Attributes["id"].Value;
                        PortfolioReference ob = new PortfolioReference(portfolioReferenceNode);
                        IDManager.SetID(portfolioReferenceIDRef_, ob);
                    }
                    else if (portfolioReferenceNode.Attributes["href"] != null)
                    {
                        portfolioReferenceIDRef_ = portfolioReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        portfolioReference_ = new PortfolioReference(portfolioReferenceNode);
                    }
                }
                else
                {
                    portfolioReference_ = new PortfolioReference(portfolioReferenceNode);
                }
            }


            XmlNode compressionActivityNode = xmlNode.SelectSingleNode("compressionActivity");

            if (compressionActivityNode != null)
            {
                if (compressionActivityNode.Attributes["href"] != null || compressionActivityNode.Attributes["id"] != null)
                {
                    if (compressionActivityNode.Attributes["id"] != null)
                    {
                        compressionActivityIDRef_ = compressionActivityNode.Attributes["id"].Value;
                        CompressionActivity ob = new CompressionActivity(compressionActivityNode);
                        IDManager.SetID(compressionActivityIDRef_, ob);
                    }
                    else if (compressionActivityNode.Attributes["href"] != null)
                    {
                        compressionActivityIDRef_ = compressionActivityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        compressionActivity_ = new CompressionActivity(compressionActivityNode);
                    }
                }
                else
                {
                    compressionActivity_ = new CompressionActivity(compressionActivityNode);
                }
            }


            XmlNode originatingEventNode = xmlNode.SelectSingleNode("originatingEvent");

            if (originatingEventNode != null)
            {
                if (originatingEventNode.Attributes["href"] != null || originatingEventNode.Attributes["id"] != null)
                {
                    if (originatingEventNode.Attributes["id"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["id"].Value;
                        OriginatingEvent ob = new OriginatingEvent(originatingEventNode);
                        IDManager.SetID(originatingEventIDRef_, ob);
                    }
                    else if (originatingEventNode.Attributes["href"] != null)
                    {
                        originatingEventIDRef_ = originatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        originatingEvent_ = new OriginatingEvent(originatingEventNode);
                    }
                }
                else
                {
                    originatingEvent_ = new OriginatingEvent(originatingEventNode);
                }
            }


            XmlNode tradeNode = xmlNode.SelectSingleNode("trade");

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


            XmlNode amendmentNode = xmlNode.SelectSingleNode("amendment");

            if (amendmentNode != null)
            {
                if (amendmentNode.Attributes["href"] != null || amendmentNode.Attributes["id"] != null)
                {
                    if (amendmentNode.Attributes["id"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["id"].Value;
                        TradeAmendmentContent ob = new TradeAmendmentContent(amendmentNode);
                        IDManager.SetID(amendmentIDRef_, ob);
                    }
                    else if (amendmentNode.Attributes["href"] != null)
                    {
                        amendmentIDRef_ = amendmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        amendment_ = new TradeAmendmentContent(amendmentNode);
                    }
                }
                else
                {
                    amendment_ = new TradeAmendmentContent(amendmentNode);
                }
            }


            XmlNode increaseNode = xmlNode.SelectSingleNode("increase");

            if (increaseNode != null)
            {
                if (increaseNode.Attributes["href"] != null || increaseNode.Attributes["id"] != null)
                {
                    if (increaseNode.Attributes["id"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(increaseNode);
                        IDManager.SetID(increaseIDRef_, ob);
                    }
                    else if (increaseNode.Attributes["href"] != null)
                    {
                        increaseIDRef_ = increaseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        increase_ = new TradeNotionalChange(increaseNode);
                    }
                }
                else
                {
                    increase_ = new TradeNotionalChange(increaseNode);
                }
            }


            XmlNode terminatingEventNode = xmlNode.SelectSingleNode("terminatingEvent");

            if (terminatingEventNode != null)
            {
                if (terminatingEventNode.Attributes["href"] != null || terminatingEventNode.Attributes["id"] != null)
                {
                    if (terminatingEventNode.Attributes["id"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["id"].Value;
                        TerminatingEvent ob = new TerminatingEvent(terminatingEventNode);
                        IDManager.SetID(terminatingEventIDRef_, ob);
                    }
                    else if (terminatingEventNode.Attributes["href"] != null)
                    {
                        terminatingEventIDRef_ = terminatingEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                    }
                }
                else
                {
                    terminatingEvent_ = new TerminatingEvent(terminatingEventNode);
                }
            }


            XmlNode terminationNode = xmlNode.SelectSingleNode("termination");

            if (terminationNode != null)
            {
                if (terminationNode.Attributes["href"] != null || terminationNode.Attributes["id"] != null)
                {
                    if (terminationNode.Attributes["id"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["id"].Value;
                        TradeNotionalChange ob = new TradeNotionalChange(terminationNode);
                        IDManager.SetID(terminationIDRef_, ob);
                    }
                    else if (terminationNode.Attributes["href"] != null)
                    {
                        terminationIDRef_ = terminationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        termination_ = new TradeNotionalChange(terminationNode);
                    }
                }
                else
                {
                    termination_ = new TradeNotionalChange(terminationNode);
                }
            }


            XmlNode novationNode = xmlNode.SelectSingleNode("novation");

            if (novationNode != null)
            {
                if (novationNode.Attributes["href"] != null || novationNode.Attributes["id"] != null)
                {
                    if (novationNode.Attributes["id"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["id"].Value;
                        TradeNovationContent ob = new TradeNovationContent(novationNode);
                        IDManager.SetID(novationIDRef_, ob);
                    }
                    else if (novationNode.Attributes["href"] != null)
                    {
                        novationIDRef_ = novationNode.Attributes["href"].Value;
                    }
                    else
                    {
                        novation_ = new TradeNovationContent(novationNode);
                    }
                }
                else
                {
                    novation_ = new TradeNovationContent(novationNode);
                }
            }


            XmlNode optionExerciseNode = xmlNode.SelectSingleNode("optionExercise");

            if (optionExerciseNode != null)
            {
                if (optionExerciseNode.Attributes["href"] != null || optionExerciseNode.Attributes["id"] != null)
                {
                    if (optionExerciseNode.Attributes["id"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["id"].Value;
                        OptionExercise ob = new OptionExercise(optionExerciseNode);
                        IDManager.SetID(optionExerciseIDRef_, ob);
                    }
                    else if (optionExerciseNode.Attributes["href"] != null)
                    {
                        optionExerciseIDRef_ = optionExerciseNode.Attributes["href"].Value;
                    }
                    else
                    {
                        optionExercise_ = new OptionExercise(optionExerciseNode);
                    }
                }
                else
                {
                    optionExercise_ = new OptionExercise(optionExerciseNode);
                }
            }


            XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");

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


            XmlNode deClearNode = xmlNode.SelectSingleNode("deClear");

            if (deClearNode != null)
            {
                if (deClearNode.Attributes["href"] != null || deClearNode.Attributes["id"] != null)
                {
                    if (deClearNode.Attributes["id"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["id"].Value;
                        DeClear ob = new DeClear(deClearNode);
                        IDManager.SetID(deClearIDRef_, ob);
                    }
                    else if (deClearNode.Attributes["href"] != null)
                    {
                        deClearIDRef_ = deClearNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deClear_ = new DeClear(deClearNode);
                    }
                }
                else
                {
                    deClear_ = new DeClear(deClearNode);
                }
            }


            XmlNode withdrawalNode = xmlNode.SelectSingleNode("withdrawal");

            if (withdrawalNode != null)
            {
                if (withdrawalNode.Attributes["href"] != null || withdrawalNode.Attributes["id"] != null)
                {
                    if (withdrawalNode.Attributes["id"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["id"].Value;
                        Withdrawal ob = new Withdrawal(withdrawalNode);
                        IDManager.SetID(withdrawalIDRef_, ob);
                    }
                    else if (withdrawalNode.Attributes["href"] != null)
                    {
                        withdrawalIDRef_ = withdrawalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        withdrawal_ = new Withdrawal(withdrawalNode);
                    }
                }
                else
                {
                    withdrawal_ = new Withdrawal(withdrawalNode);
                }
            }


            XmlNode additionalEventNode = xmlNode.SelectSingleNode("additionalEvent");

            if (additionalEventNode != null)
            {
                if (additionalEventNode.Attributes["href"] != null || additionalEventNode.Attributes["id"] != null)
                {
                    if (additionalEventNode.Attributes["id"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["id"].Value;
                        AdditionalEvent ob = new AdditionalEvent(additionalEventNode);
                        IDManager.SetID(additionalEventIDRef_, ob);
                    }
                    else if (additionalEventNode.Attributes["href"] != null)
                    {
                        additionalEventIDRef_ = additionalEventNode.Attributes["href"].Value;
                    }
                    else
                    {
                        additionalEvent_ = new AdditionalEvent(additionalEventNode);
                    }
                }
                else
                {
                    additionalEvent_ = new AdditionalEvent(additionalEventNode);
                }
            }


            XmlNodeList quoteNodeList = xmlNode.SelectNodes("quote");

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


            XmlNodeList partyNodeList = xmlNode.SelectNodes("party");

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


            XmlNodeList accountNodeList = xmlNode.SelectNodes("account");

            if (accountNodeList != null)
            {
                this.account_ = new List <Account>();
                foreach (XmlNode item in accountNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            accountIDRef_ = item.Attributes["id"].Value;
                            account_.Add(new Account(item));
                            IDManager.SetID(accountIDRef_, account_[account_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            accountIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            account_.Add(new Account(item));
                        }
                    }
                    else
                    {
                        account_.Add(new Account(item));
                    }
                }
            }
        }
        public EventProposedMatch(XmlNode xmlNode)
        {
            XmlNodeList originatingEventNodeList = xmlNode.SelectNodes("originatingEvent");
            if (originatingEventNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in originatingEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        originatingEventIDRef = item.Attributes["id"].Name;
                        OriginatingEvent ob = OriginatingEvent();
                        IDManager.SetID(originatingEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        originatingEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        originatingEvent = new OriginatingEvent(item);
                    }
                }
            }

            XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
            if (tradeNodeList.Count > 1 )
            {
                    throw new Exception();
            }

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

            XmlNodeList amendmentNodeList = xmlNode.SelectNodes("amendment");
            if (amendmentNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in amendmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        amendmentIDRef = item.Attributes["id"].Name;
                        TradeAmendmentContent ob = TradeAmendmentContent();
                        IDManager.SetID(amendmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        amendmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        amendment = new TradeAmendmentContent(item);
                    }
                }
            }

            XmlNodeList increaseNodeList = xmlNode.SelectNodes("increase");
            if (increaseNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in increaseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        increaseIDRef = item.Attributes["id"].Name;
                        TradeNotionalChange ob = TradeNotionalChange();
                        IDManager.SetID(increaseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        increaseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        increase = new TradeNotionalChange(item);
                    }
                }
            }

            XmlNodeList terminatingEventNodeList = xmlNode.SelectNodes("terminatingEvent");
            if (terminatingEventNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in terminatingEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminatingEventIDRef = item.Attributes["id"].Name;
                        TerminatingEvent ob = TerminatingEvent();
                        IDManager.SetID(terminatingEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminatingEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        terminatingEvent = new TerminatingEvent(item);
                    }
                }
            }

            XmlNodeList terminationNodeList = xmlNode.SelectNodes("termination");
            if (terminationNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in terminationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        terminationIDRef = item.Attributes["id"].Name;
                        TradeNotionalChange ob = TradeNotionalChange();
                        IDManager.SetID(terminationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        terminationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        termination = new TradeNotionalChange(item);
                    }
                }
            }

            XmlNodeList novationNodeList = xmlNode.SelectNodes("novation");
            if (novationNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in novationNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        novationIDRef = item.Attributes["id"].Name;
                        TradeNovationContent ob = TradeNovationContent();
                        IDManager.SetID(novationIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        novationIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        novation = new TradeNovationContent(item);
                    }
                }
            }

            XmlNodeList optionExerciseNodeList = xmlNode.SelectNodes("optionExercise");
            if (optionExerciseNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in optionExerciseNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        optionExerciseIDRef = item.Attributes["id"].Name;
                        OptionExercise ob = OptionExercise();
                        IDManager.SetID(optionExerciseIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        optionExerciseIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        optionExercise = new OptionExercise(item);
                    }
                }
            }

            XmlNodeList optionExpiryNodeList = xmlNode.SelectNodes("optionExpiry");

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

            XmlNodeList deClearNodeList = xmlNode.SelectNodes("deClear");
            if (deClearNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in deClearNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deClearIDRef = item.Attributes["id"].Name;
                        DeClear ob = DeClear();
                        IDManager.SetID(deClearIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deClearIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deClear = new DeClear(item);
                    }
                }
            }

            XmlNodeList withdrawalNodeList = xmlNode.SelectNodes("withdrawal");
            if (withdrawalNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in withdrawalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        withdrawalIDRef = item.Attributes["id"].Name;
                        Withdrawal ob = Withdrawal();
                        IDManager.SetID(withdrawalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        withdrawalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        withdrawal = new Withdrawal(item);
                    }
                }
            }

            XmlNodeList additionalEventNodeList = xmlNode.SelectNodes("additionalEvent");
            if (additionalEventNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in additionalEventNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        additionalEventIDRef = item.Attributes["id"].Name;
                        AdditionalEvent ob = AdditionalEvent();
                        IDManager.SetID(additionalEventIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        additionalEventIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        additionalEvent = new AdditionalEvent(item);
                    }
                }
            }

            XmlNodeList matchIdNodeList = xmlNode.SelectNodes("matchId");
            if (matchIdNodeList.Count > 1 )
            {
                    throw new Exception();
            }

            foreach (XmlNode item in matchIdNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        matchIdIDRef = item.Attributes["id"].Name;
                        MatchId ob = MatchId();
                        IDManager.SetID(matchIdIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        matchIdIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        matchId = new MatchId(item);
                    }
                }
            }

            XmlNodeList differenceNodeList = xmlNode.SelectNodes("difference");

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

            XmlNodeList matchScoreNodeList = xmlNode.SelectNodes("matchScore");
            if (matchScoreNodeList.Count > 1 )
            {
                    throw new Exception();
            }

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