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 TradeWrapper(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 tradeReferenceInformationNode = xmlNode.SelectSingleNode("tradeReferenceInformation");
     
     if (tradeReferenceInformationNode != null)
     {
         if (tradeReferenceInformationNode.Attributes["href"] != null || tradeReferenceInformationNode.Attributes["id"] != null) 
         {
             if (tradeReferenceInformationNode.Attributes["id"] != null) 
             {
                 tradeReferenceInformationIDRef_ = tradeReferenceInformationNode.Attributes["id"].Value;
                 TradeReferenceInformation ob = new TradeReferenceInformation(tradeReferenceInformationNode);
                 IDManager.SetID(tradeReferenceInformationIDRef_, ob);
             }
             else if (tradeReferenceInformationNode.Attributes["href"] != null)
             {
                 tradeReferenceInformationIDRef_ = tradeReferenceInformationNode.Attributes["href"].Value;
             }
             else
             {
                 tradeReferenceInformation_ = new TradeReferenceInformation(tradeReferenceInformationNode);
             }
         }
         else
         {
             tradeReferenceInformation_ = new TradeReferenceInformation(tradeReferenceInformationNode);
         }
     }
     
 
 }
 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 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));
             }
         }
     }
     
 
 }
 public DataDocument(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList validationNodeList = xmlNode.SelectNodes("validation");
     
     foreach (XmlNode item in validationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 validationIDRef = item.Attributes["id"].Name;
                 List<Validation> ob = new List<Validation>();
                 ob.Add(new Validation(item));
                 IDManager.SetID(validationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 validationIDRef = item.Attributes["href"].Name;
             }
             else
             {
             validation.Add(new Validation(item));
             }
         }
     }
     
 
     XmlNodeList onBehalfOfNodeList = xmlNode.SelectNodes("onBehalfOf");
     if (onBehalfOfNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in onBehalfOfNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 onBehalfOfIDRef = item.Attributes["id"].Name;
                 OnBehalfOf ob = OnBehalfOf();
                 IDManager.SetID(onBehalfOfIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 onBehalfOfIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 onBehalfOf = new OnBehalfOf(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");
     
     foreach (XmlNode item in tradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 tradeIDRef = item.Attributes["id"].Name;
                 List<Trade> ob = new List<Trade>();
                 ob.Add(new Trade(item));
                 IDManager.SetID(tradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 tradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
             trade.Add(new Trade(item));
             }
         }
     }
     
 
     XmlNodeList portfolioNodeList = xmlNode.SelectNodes("portfolio");
     
     foreach (XmlNode item in portfolioNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 portfolioIDRef = item.Attributes["id"].Name;
                 List<Portfolio> ob = new List<Portfolio>();
                 ob.Add(new Portfolio(item));
                 IDManager.SetID(portfolioIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 portfolioIDRef = item.Attributes["href"].Name;
             }
             else
             {
             portfolio.Add(new Portfolio(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 TradeWrapper(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 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);
             }
         }
     }
     
 
 }
 public TradeReferenceInformation(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 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 partyTradeIdentifierNodeList = xmlNode.SelectNodes("partyTradeIdentifier");
     
     foreach (XmlNode item in partyTradeIdentifierNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyTradeIdentifierIDRef = item.Attributes["id"].Name;
                 List<PartyTradeIdentifier> ob = new List<PartyTradeIdentifier>();
                 ob.Add(new PartyTradeIdentifier(item));
                 IDManager.SetID(partyTradeIdentifierIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyTradeIdentifierIDRef = item.Attributes["href"].Name;
             }
             else
             {
             partyTradeIdentifier.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList partyTradeInformationNodeList = xmlNode.SelectNodes("partyTradeInformation");
     
     foreach (XmlNode item in partyTradeInformationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyTradeInformationIDRef = item.Attributes["id"].Name;
                 List<PartyTradeInformation> ob = new List<PartyTradeInformation>();
                 ob.Add(new PartyTradeInformation(item));
                 IDManager.SetID(partyTradeInformationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyTradeInformationIDRef = item.Attributes["href"].Name;
             }
             else
             {
             partyTradeInformation.Add(new PartyTradeInformation(item));
             }
         }
     }
     
 
     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 productIdNodeList = xmlNode.SelectNodes("productId");
     if (productIdNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in productIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 productIdIDRef = item.Attributes["id"].Name;
                 ProductId ob = ProductId();
                 IDManager.SetID(productIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 productIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 productId = new ProductId(item);
             }
         }
     }
     
 
 }
 public TradeReferenceInformation(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 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);
         }
     }
     
 
     XmlNodeList partyTradeIdentifierNodeList = xmlNode.SelectNodes("partyTradeIdentifier");
     
     if (partyTradeIdentifierNodeList != null)
     {
         this.partyTradeIdentifier_ = new List<PartyTradeIdentifier>();
         foreach (XmlNode item in partyTradeIdentifierNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     partyTradeIdentifierIDRef_ = item.Attributes["id"].Value;
                     partyTradeIdentifier_.Add(new PartyTradeIdentifier(item));
                     IDManager.SetID(partyTradeIdentifierIDRef_, partyTradeIdentifier_[partyTradeIdentifier_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     partyTradeIdentifierIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 partyTradeIdentifier_.Add(new PartyTradeIdentifier(item));
                 }
             }
             else
             {
                 partyTradeIdentifier_.Add(new PartyTradeIdentifier(item));
             }
         }
     }
     
 
     XmlNodeList partyTradeInformationNodeList = xmlNode.SelectNodes("partyTradeInformation");
     
     if (partyTradeInformationNodeList != null)
     {
         this.partyTradeInformation_ = new List<PartyTradeInformation>();
         foreach (XmlNode item in partyTradeInformationNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     partyTradeInformationIDRef_ = item.Attributes["id"].Value;
                     partyTradeInformation_.Add(new PartyTradeInformation(item));
                     IDManager.SetID(partyTradeInformationIDRef_, partyTradeInformation_[partyTradeInformation_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     partyTradeInformationIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 partyTradeInformation_.Add(new PartyTradeInformation(item));
                 }
             }
             else
             {
                 partyTradeInformation_.Add(new PartyTradeInformation(item));
             }
         }
     }
     
 
     XmlNode productTypeNode = xmlNode.SelectSingleNode("productType");
     
     if (productTypeNode != null)
     {
         if (productTypeNode.Attributes["href"] != null || productTypeNode.Attributes["id"] != null) 
         {
             if (productTypeNode.Attributes["id"] != null) 
             {
                 productTypeIDRef_ = productTypeNode.Attributes["id"].Value;
                 ProductType ob = new ProductType(productTypeNode);
                 IDManager.SetID(productTypeIDRef_, ob);
             }
             else if (productTypeNode.Attributes["href"] != null)
             {
                 productTypeIDRef_ = productTypeNode.Attributes["href"].Value;
             }
             else
             {
                 productType_ = new ProductType(productTypeNode);
             }
         }
         else
         {
             productType_ = new ProductType(productTypeNode);
         }
     }
     
 
     XmlNode productIdNode = xmlNode.SelectSingleNode("productId");
     
     if (productIdNode != null)
     {
         if (productIdNode.Attributes["href"] != null || productIdNode.Attributes["id"] != null) 
         {
             if (productIdNode.Attributes["id"] != null) 
             {
                 productIdIDRef_ = productIdNode.Attributes["id"].Value;
                 ProductId ob = new ProductId(productIdNode);
                 IDManager.SetID(productIdIDRef_, ob);
             }
             else if (productIdNode.Attributes["href"] != null)
             {
                 productIdIDRef_ = productIdNode.Attributes["href"].Value;
             }
             else
             {
                 productId_ = new ProductId(productIdNode);
             }
         }
         else
         {
             productId_ = new ProductId(productIdNode);
         }
     }
     
 
 }
 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 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 DataDocument(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList validationNodeList = xmlNode.SelectNodes("validation");
     
     if (validationNodeList != null)
     {
         this.validation_ = new List<Validation>();
         foreach (XmlNode item in validationNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     validationIDRef_ = item.Attributes["id"].Value;
                     validation_.Add(new Validation(item));
                     IDManager.SetID(validationIDRef_, validation_[validation_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     validationIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 validation_.Add(new Validation(item));
                 }
             }
             else
             {
                 validation_.Add(new Validation(item));
             }
         }
     }
     
 
     XmlNode onBehalfOfNode = xmlNode.SelectSingleNode("onBehalfOf");
     
     if (onBehalfOfNode != null)
     {
         if (onBehalfOfNode.Attributes["href"] != null || onBehalfOfNode.Attributes["id"] != null) 
         {
             if (onBehalfOfNode.Attributes["id"] != null) 
             {
                 onBehalfOfIDRef_ = onBehalfOfNode.Attributes["id"].Value;
                 OnBehalfOf ob = new OnBehalfOf(onBehalfOfNode);
                 IDManager.SetID(onBehalfOfIDRef_, ob);
             }
             else if (onBehalfOfNode.Attributes["href"] != null)
             {
                 onBehalfOfIDRef_ = onBehalfOfNode.Attributes["href"].Value;
             }
             else
             {
                 onBehalfOf_ = new OnBehalfOf(onBehalfOfNode);
             }
         }
         else
         {
             onBehalfOf_ = new OnBehalfOf(onBehalfOfNode);
         }
     }
     
 
     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);
         }
     }
     
 
     XmlNodeList tradeNodeList = xmlNode.SelectNodes("trade");
     
     if (tradeNodeList != null)
     {
         this.trade_ = new List<Trade>();
         foreach (XmlNode item in tradeNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     tradeIDRef_ = item.Attributes["id"].Value;
                     trade_.Add(new Trade(item));
                     IDManager.SetID(tradeIDRef_, trade_[trade_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     tradeIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 trade_.Add(new Trade(item));
                 }
             }
             else
             {
                 trade_.Add(new Trade(item));
             }
         }
     }
     
 
     XmlNodeList portfolioNodeList = xmlNode.SelectNodes("portfolio");
     
     if (portfolioNodeList != null)
     {
         this.portfolio_ = new List<Portfolio>();
         foreach (XmlNode item in portfolioNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     portfolioIDRef_ = item.Attributes["id"].Value;
                     portfolio_.Add(new Portfolio(item));
                     IDManager.SetID(portfolioIDRef_, portfolio_[portfolio_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     portfolioIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 portfolio_.Add(new Portfolio(item));
                 }
             }
             else
             {
                 portfolio_.Add(new Portfolio(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 ImpliedTrade(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 paymentNodeList = xmlNode.SelectNodes("payment");
     if (paymentNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in paymentNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 paymentIDRef = item.Attributes["id"].Name;
                 NonNegativePayment ob = NonNegativePayment();
                 IDManager.SetID(paymentIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 paymentIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 payment = new NonNegativePayment(item);
             }
         }
     }
     
 
 }
 public ImpliedTrade(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 paymentNode = xmlNode.SelectSingleNode("payment");
     
     if (paymentNode != null)
     {
         if (paymentNode.Attributes["href"] != null || paymentNode.Attributes["id"] != null) 
         {
             if (paymentNode.Attributes["id"] != null) 
             {
                 paymentIDRef_ = paymentNode.Attributes["id"].Value;
                 NonNegativePayment ob = new NonNegativePayment(paymentNode);
                 IDManager.SetID(paymentIDRef_, ob);
             }
             else if (paymentNode.Attributes["href"] != null)
             {
                 paymentIDRef_ = paymentNode.Attributes["href"].Value;
             }
             else
             {
                 payment_ = new NonNegativePayment(paymentNode);
             }
         }
         else
         {
             payment_ = new NonNegativePayment(paymentNode);
         }
     }
     
 
 }