public Clearing(XmlNode xmlNode)
 {
     XmlNodeList submittedNodeList = xmlNode.SelectNodes("submitted");
     if (submittedNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in submittedNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 submittedIDRef = item.Attributes["id"].Name;
                 TradeWrapper ob = TradeWrapper();
                 IDManager.SetID(submittedIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 submittedIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 submitted = new TradeWrapper(item);
             }
         }
     }
     
 
     XmlNodeList clearedNodeList = xmlNode.SelectNodes("cleared");
     
     foreach (XmlNode item in clearedNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 clearedIDRef = item.Attributes["id"].Name;
                 List<TradeWrapper> ob = new List<TradeWrapper>();
                 ob.Add(new TradeWrapper(item));
                 IDManager.SetID(clearedIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 clearedIDRef = item.Attributes["href"].Name;
             }
             else
             {
             cleared.Add(new TradeWrapper(item));
             }
         }
     }
     
 
 }
        public Clearing(XmlNode xmlNode)
        {
            XmlNodeList submittedNodeList = xmlNode.SelectNodes("submitted");

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

            foreach (XmlNode item in submittedNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        submittedIDRef = item.Attributes["id"].Name;
                        TradeWrapper ob = TradeWrapper();
                        IDManager.SetID(submittedIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        submittedIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        submitted = new TradeWrapper(item);
                    }
                }
            }


            XmlNodeList clearedNodeList = xmlNode.SelectNodes("cleared");

            foreach (XmlNode item in clearedNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        clearedIDRef = item.Attributes["id"].Name;
                        List <TradeWrapper> ob = new List <TradeWrapper>();
                        ob.Add(new TradeWrapper(item));
                        IDManager.SetID(clearedIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        clearedIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        cleared.Add(new TradeWrapper(item));
                    }
                }
            }
        }
        public Clearing(XmlNode xmlNode)
        {
            XmlNode submittedNode = xmlNode.SelectSingleNode("submitted");

            if (submittedNode != null)
            {
                if (submittedNode.Attributes["href"] != null || submittedNode.Attributes["id"] != null)
                {
                    if (submittedNode.Attributes["id"] != null)
                    {
                        submittedIDRef_ = submittedNode.Attributes["id"].Value;
                        TradeWrapper ob = new TradeWrapper(submittedNode);
                        IDManager.SetID(submittedIDRef_, ob);
                    }
                    else if (submittedNode.Attributes["href"] != null)
                    {
                        submittedIDRef_ = submittedNode.Attributes["href"].Value;
                    }
                    else
                    {
                        submitted_ = new TradeWrapper(submittedNode);
                    }
                }
                else
                {
                    submitted_ = new TradeWrapper(submittedNode);
                }
            }


            XmlNodeList clearedNodeList = xmlNode.SelectNodes("cleared");

            if (clearedNodeList != null)
            {
                this.cleared_ = new List <TradeWrapper>();
                foreach (XmlNode item in clearedNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            clearedIDRef_ = item.Attributes["id"].Value;
                            cleared_.Add(new TradeWrapper(item));
                            IDManager.SetID(clearedIDRef_, cleared_[cleared_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            clearedIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            cleared_.Add(new TradeWrapper(item));
                        }
                    }
                    else
                    {
                        cleared_.Add(new TradeWrapper(item));
                    }
                }
            }
        }
 public Clearing(XmlNode xmlNode)
 {
     XmlNode submittedNode = xmlNode.SelectSingleNode("submitted");
     
     if (submittedNode != null)
     {
         if (submittedNode.Attributes["href"] != null || submittedNode.Attributes["id"] != null) 
         {
             if (submittedNode.Attributes["id"] != null) 
             {
                 submittedIDRef_ = submittedNode.Attributes["id"].Value;
                 TradeWrapper ob = new TradeWrapper(submittedNode);
                 IDManager.SetID(submittedIDRef_, ob);
             }
             else if (submittedNode.Attributes["href"] != null)
             {
                 submittedIDRef_ = submittedNode.Attributes["href"].Value;
             }
             else
             {
                 submitted_ = new TradeWrapper(submittedNode);
             }
         }
         else
         {
             submitted_ = new TradeWrapper(submittedNode);
         }
     }
     
 
     XmlNodeList clearedNodeList = xmlNode.SelectNodes("cleared");
     
     if (clearedNodeList != null)
     {
         this.cleared_ = new List<TradeWrapper>();
         foreach (XmlNode item in clearedNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     clearedIDRef_ = item.Attributes["id"].Value;
                     cleared_.Add(new TradeWrapper(item));
                     IDManager.SetID(clearedIDRef_, cleared_[cleared_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     clearedIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 cleared_.Add(new TradeWrapper(item));
                 }
             }
             else
             {
                 cleared_.Add(new TradeWrapper(item));
             }
         }
     }
     
 
 }