public Party(XmlNode xmlNode)
 {
     XmlNodeList partyIdNodeList = xmlNode.SelectNodes("partyId");
     
     if (partyIdNodeList != null)
     {
         this.partyId_ = new List<PartyId>();
         foreach (XmlNode item in partyIdNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     partyIdIDRef_ = item.Attributes["id"].Value;
                     partyId_.Add(new PartyId(item));
                     IDManager.SetID(partyIdIDRef_, partyId_[partyId_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     partyIdIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 partyId_.Add(new PartyId(item));
                 }
             }
             else
             {
                 partyId_.Add(new PartyId(item));
             }
         }
     }
     
 
     XmlNode partyNameNode = xmlNode.SelectSingleNode("partyName");
     
     if (partyNameNode != null)
     {
         if (partyNameNode.Attributes["href"] != null || partyNameNode.Attributes["id"] != null) 
         {
             if (partyNameNode.Attributes["id"] != null) 
             {
                 partyNameIDRef_ = partyNameNode.Attributes["id"].Value;
                 PartyName ob = new PartyName(partyNameNode);
                 IDManager.SetID(partyNameIDRef_, ob);
             }
             else if (partyNameNode.Attributes["href"] != null)
             {
                 partyNameIDRef_ = partyNameNode.Attributes["href"].Value;
             }
             else
             {
                 partyName_ = new PartyName(partyNameNode);
             }
         }
         else
         {
             partyName_ = new PartyName(partyNameNode);
         }
     }
     
 
     XmlNodeList classificationNodeList = xmlNode.SelectNodes("classification");
     
     if (classificationNodeList != null)
     {
         this.classification_ = new List<IndustryClassification>();
         foreach (XmlNode item in classificationNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     classificationIDRef_ = item.Attributes["id"].Value;
                     classification_.Add(new IndustryClassification(item));
                     IDManager.SetID(classificationIDRef_, classification_[classification_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     classificationIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 classification_.Add(new IndustryClassification(item));
                 }
             }
             else
             {
                 classification_.Add(new IndustryClassification(item));
             }
         }
     }
     
 
     XmlNodeList creditRatingNodeList = xmlNode.SelectNodes("creditRating");
     
     if (creditRatingNodeList != null)
     {
         this.creditRating_ = new List<CreditRating>();
         foreach (XmlNode item in creditRatingNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     creditRatingIDRef_ = item.Attributes["id"].Value;
                     creditRating_.Add(new CreditRating(item));
                     IDManager.SetID(creditRatingIDRef_, creditRating_[creditRating_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     creditRatingIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 creditRating_.Add(new CreditRating(item));
                 }
             }
             else
             {
                 creditRating_.Add(new CreditRating(item));
             }
         }
     }
     
 
     XmlNode countryNode = xmlNode.SelectSingleNode("country");
     
     if (countryNode != null)
     {
         if (countryNode.Attributes["href"] != null || countryNode.Attributes["id"] != null) 
         {
             if (countryNode.Attributes["id"] != null) 
             {
                 countryIDRef_ = countryNode.Attributes["id"].Value;
                 CountryCode ob = new CountryCode(countryNode);
                 IDManager.SetID(countryIDRef_, ob);
             }
             else if (countryNode.Attributes["href"] != null)
             {
                 countryIDRef_ = countryNode.Attributes["href"].Value;
             }
             else
             {
                 country_ = new CountryCode(countryNode);
             }
         }
         else
         {
             country_ = new CountryCode(countryNode);
         }
     }
     
 
     XmlNodeList jurisdictionNodeList = xmlNode.SelectNodes("jurisdiction");
     
     if (jurisdictionNodeList != null)
     {
         this.jurisdiction_ = new List<GoverningLaw>();
         foreach (XmlNode item in jurisdictionNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     jurisdictionIDRef_ = item.Attributes["id"].Value;
                     jurisdiction_.Add(new GoverningLaw(item));
                     IDManager.SetID(jurisdictionIDRef_, jurisdiction_[jurisdiction_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     jurisdictionIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 jurisdiction_.Add(new GoverningLaw(item));
                 }
             }
             else
             {
                 jurisdiction_.Add(new GoverningLaw(item));
             }
         }
     }
     
 
     XmlNode organizationTypeNode = xmlNode.SelectSingleNode("organizationType");
     
     if (organizationTypeNode != null)
     {
         if (organizationTypeNode.Attributes["href"] != null || organizationTypeNode.Attributes["id"] != null) 
         {
             if (organizationTypeNode.Attributes["id"] != null) 
             {
                 organizationTypeIDRef_ = organizationTypeNode.Attributes["id"].Value;
                 OrganizationType ob = new OrganizationType(organizationTypeNode);
                 IDManager.SetID(organizationTypeIDRef_, ob);
             }
             else if (organizationTypeNode.Attributes["href"] != null)
             {
                 organizationTypeIDRef_ = organizationTypeNode.Attributes["href"].Value;
             }
             else
             {
                 organizationType_ = new OrganizationType(organizationTypeNode);
             }
         }
         else
         {
             organizationType_ = new OrganizationType(organizationTypeNode);
         }
     }
     
 
     XmlNode contactInfoNode = xmlNode.SelectSingleNode("contactInfo");
     
     if (contactInfoNode != null)
     {
         if (contactInfoNode.Attributes["href"] != null || contactInfoNode.Attributes["id"] != null) 
         {
             if (contactInfoNode.Attributes["id"] != null) 
             {
                 contactInfoIDRef_ = contactInfoNode.Attributes["id"].Value;
                 ContactInformation ob = new ContactInformation(contactInfoNode);
                 IDManager.SetID(contactInfoIDRef_, ob);
             }
             else if (contactInfoNode.Attributes["href"] != null)
             {
                 contactInfoIDRef_ = contactInfoNode.Attributes["href"].Value;
             }
             else
             {
                 contactInfo_ = new ContactInformation(contactInfoNode);
             }
         }
         else
         {
             contactInfo_ = new ContactInformation(contactInfoNode);
         }
     }
     
 
     XmlNodeList businessUnitNodeList = xmlNode.SelectNodes("businessUnit");
     
     if (businessUnitNodeList != null)
     {
         this.businessUnit_ = new List<BusinessUnit>();
         foreach (XmlNode item in businessUnitNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     businessUnitIDRef_ = item.Attributes["id"].Value;
                     businessUnit_.Add(new BusinessUnit(item));
                     IDManager.SetID(businessUnitIDRef_, businessUnit_[businessUnit_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     businessUnitIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 businessUnit_.Add(new BusinessUnit(item));
                 }
             }
             else
             {
                 businessUnit_.Add(new BusinessUnit(item));
             }
         }
     }
     
 
     XmlNodeList personNodeList = xmlNode.SelectNodes("person");
     
     if (personNodeList != null)
     {
         this.person_ = new List<Person>();
         foreach (XmlNode item in personNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     personIDRef_ = item.Attributes["id"].Value;
                     person_.Add(new Person(item));
                     IDManager.SetID(personIDRef_, person_[person_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     personIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 person_.Add(new Person(item));
                 }
             }
             else
             {
                 person_.Add(new Person(item));
             }
         }
     }
     
 
 }
        public Party(XmlNode xmlNode)
        {
            XmlNodeList partyIdNodeList = xmlNode.SelectNodes("partyId");

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


            XmlNode partyNameNode = xmlNode.SelectSingleNode("partyName");

            if (partyNameNode != null)
            {
                if (partyNameNode.Attributes["href"] != null || partyNameNode.Attributes["id"] != null)
                {
                    if (partyNameNode.Attributes["id"] != null)
                    {
                        partyNameIDRef_ = partyNameNode.Attributes["id"].Value;
                        PartyName ob = new PartyName(partyNameNode);
                        IDManager.SetID(partyNameIDRef_, ob);
                    }
                    else if (partyNameNode.Attributes["href"] != null)
                    {
                        partyNameIDRef_ = partyNameNode.Attributes["href"].Value;
                    }
                    else
                    {
                        partyName_ = new PartyName(partyNameNode);
                    }
                }
                else
                {
                    partyName_ = new PartyName(partyNameNode);
                }
            }


            XmlNodeList classificationNodeList = xmlNode.SelectNodes("classification");

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


            XmlNodeList creditRatingNodeList = xmlNode.SelectNodes("creditRating");

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


            XmlNode countryNode = xmlNode.SelectSingleNode("country");

            if (countryNode != null)
            {
                if (countryNode.Attributes["href"] != null || countryNode.Attributes["id"] != null)
                {
                    if (countryNode.Attributes["id"] != null)
                    {
                        countryIDRef_ = countryNode.Attributes["id"].Value;
                        CountryCode ob = new CountryCode(countryNode);
                        IDManager.SetID(countryIDRef_, ob);
                    }
                    else if (countryNode.Attributes["href"] != null)
                    {
                        countryIDRef_ = countryNode.Attributes["href"].Value;
                    }
                    else
                    {
                        country_ = new CountryCode(countryNode);
                    }
                }
                else
                {
                    country_ = new CountryCode(countryNode);
                }
            }


            XmlNodeList jurisdictionNodeList = xmlNode.SelectNodes("jurisdiction");

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


            XmlNode organizationTypeNode = xmlNode.SelectSingleNode("organizationType");

            if (organizationTypeNode != null)
            {
                if (organizationTypeNode.Attributes["href"] != null || organizationTypeNode.Attributes["id"] != null)
                {
                    if (organizationTypeNode.Attributes["id"] != null)
                    {
                        organizationTypeIDRef_ = organizationTypeNode.Attributes["id"].Value;
                        OrganizationType ob = new OrganizationType(organizationTypeNode);
                        IDManager.SetID(organizationTypeIDRef_, ob);
                    }
                    else if (organizationTypeNode.Attributes["href"] != null)
                    {
                        organizationTypeIDRef_ = organizationTypeNode.Attributes["href"].Value;
                    }
                    else
                    {
                        organizationType_ = new OrganizationType(organizationTypeNode);
                    }
                }
                else
                {
                    organizationType_ = new OrganizationType(organizationTypeNode);
                }
            }


            XmlNode contactInfoNode = xmlNode.SelectSingleNode("contactInfo");

            if (contactInfoNode != null)
            {
                if (contactInfoNode.Attributes["href"] != null || contactInfoNode.Attributes["id"] != null)
                {
                    if (contactInfoNode.Attributes["id"] != null)
                    {
                        contactInfoIDRef_ = contactInfoNode.Attributes["id"].Value;
                        ContactInformation ob = new ContactInformation(contactInfoNode);
                        IDManager.SetID(contactInfoIDRef_, ob);
                    }
                    else if (contactInfoNode.Attributes["href"] != null)
                    {
                        contactInfoIDRef_ = contactInfoNode.Attributes["href"].Value;
                    }
                    else
                    {
                        contactInfo_ = new ContactInformation(contactInfoNode);
                    }
                }
                else
                {
                    contactInfo_ = new ContactInformation(contactInfoNode);
                }
            }


            XmlNodeList businessUnitNodeList = xmlNode.SelectNodes("businessUnit");

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


            XmlNodeList personNodeList = xmlNode.SelectNodes("person");

            if (personNodeList != null)
            {
                this.person_ = new List <Person>();
                foreach (XmlNode item in personNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            personIDRef_ = item.Attributes["id"].Value;
                            person_.Add(new Person(item));
                            IDManager.SetID(personIDRef_, person_[person_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            personIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            person_.Add(new Person(item));
                        }
                    }
                    else
                    {
                        person_.Add(new Person(item));
                    }
                }
            }
        }
 public Party(XmlNode xmlNode)
 {
     XmlNodeList partyIdNodeList = xmlNode.SelectNodes("partyId");
     
     foreach (XmlNode item in partyIdNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyIdIDRef = item.Attributes["id"].Name;
                 List<PartyId> ob = new List<PartyId>();
                 ob.Add(new PartyId(item));
                 IDManager.SetID(partyIdIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyIdIDRef = item.Attributes["href"].Name;
             }
             else
             {
             partyId.Add(new PartyId(item));
             }
         }
     }
     
 
     XmlNodeList partyNameNodeList = xmlNode.SelectNodes("partyName");
     if (partyNameNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in partyNameNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 partyNameIDRef = item.Attributes["id"].Name;
                 PartyName ob = PartyName();
                 IDManager.SetID(partyNameIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 partyNameIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 partyName = new PartyName(item);
             }
         }
     }
     
 
     XmlNodeList classificationNodeList = xmlNode.SelectNodes("classification");
     
     foreach (XmlNode item in classificationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 classificationIDRef = item.Attributes["id"].Name;
                 List<IndustryClassification> ob = new List<IndustryClassification>();
                 ob.Add(new IndustryClassification(item));
                 IDManager.SetID(classificationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 classificationIDRef = item.Attributes["href"].Name;
             }
             else
             {
             classification.Add(new IndustryClassification(item));
             }
         }
     }
     
 
     XmlNodeList creditRatingNodeList = xmlNode.SelectNodes("creditRating");
     
     foreach (XmlNode item in creditRatingNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 creditRatingIDRef = item.Attributes["id"].Name;
                 List<CreditRating> ob = new List<CreditRating>();
                 ob.Add(new CreditRating(item));
                 IDManager.SetID(creditRatingIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 creditRatingIDRef = item.Attributes["href"].Name;
             }
             else
             {
             creditRating.Add(new CreditRating(item));
             }
         }
     }
     
 
     XmlNodeList countryNodeList = xmlNode.SelectNodes("country");
     if (countryNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in countryNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 countryIDRef = item.Attributes["id"].Name;
                 CountryCode ob = CountryCode();
                 IDManager.SetID(countryIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 countryIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 country = new CountryCode(item);
             }
         }
     }
     
 
     XmlNodeList jurisdictionNodeList = xmlNode.SelectNodes("jurisdiction");
     
     foreach (XmlNode item in jurisdictionNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 jurisdictionIDRef = item.Attributes["id"].Name;
                 List<GoverningLaw> ob = new List<GoverningLaw>();
                 ob.Add(new GoverningLaw(item));
                 IDManager.SetID(jurisdictionIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 jurisdictionIDRef = item.Attributes["href"].Name;
             }
             else
             {
             jurisdiction.Add(new GoverningLaw(item));
             }
         }
     }
     
 
     XmlNodeList organizationTypeNodeList = xmlNode.SelectNodes("organizationType");
     if (organizationTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in organizationTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 organizationTypeIDRef = item.Attributes["id"].Name;
                 OrganizationType ob = OrganizationType();
                 IDManager.SetID(organizationTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 organizationTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 organizationType = new OrganizationType(item);
             }
         }
     }
     
 
     XmlNodeList contactInfoNodeList = xmlNode.SelectNodes("contactInfo");
     if (contactInfoNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in contactInfoNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 contactInfoIDRef = item.Attributes["id"].Name;
                 ContactInformation ob = ContactInformation();
                 IDManager.SetID(contactInfoIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 contactInfoIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 contactInfo = new ContactInformation(item);
             }
         }
     }
     
 
     XmlNodeList businessUnitNodeList = xmlNode.SelectNodes("businessUnit");
     
     foreach (XmlNode item in businessUnitNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 businessUnitIDRef = item.Attributes["id"].Name;
                 List<BusinessUnit> ob = new List<BusinessUnit>();
                 ob.Add(new BusinessUnit(item));
                 IDManager.SetID(businessUnitIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 businessUnitIDRef = item.Attributes["href"].Name;
             }
             else
             {
             businessUnit.Add(new BusinessUnit(item));
             }
         }
     }
     
 
     XmlNodeList personNodeList = xmlNode.SelectNodes("person");
     
     foreach (XmlNode item in personNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 personIDRef = item.Attributes["id"].Name;
                 List<Person> ob = new List<Person>();
                 ob.Add(new Person(item));
                 IDManager.SetID(personIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 personIDRef = item.Attributes["href"].Name;
             }
             else
             {
             person.Add(new Person(item));
             }
         }
     }
     
 
 }
        public Party(XmlNode xmlNode)
        {
            XmlNodeList partyIdNodeList = xmlNode.SelectNodes("partyId");

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


            XmlNodeList partyNameNodeList = xmlNode.SelectNodes("partyName");

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

            foreach (XmlNode item in partyNameNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        partyNameIDRef = item.Attributes["id"].Name;
                        PartyName ob = PartyName();
                        IDManager.SetID(partyNameIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        partyNameIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        partyName = new PartyName(item);
                    }
                }
            }


            XmlNodeList classificationNodeList = xmlNode.SelectNodes("classification");

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


            XmlNodeList creditRatingNodeList = xmlNode.SelectNodes("creditRating");

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


            XmlNodeList countryNodeList = xmlNode.SelectNodes("country");

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

            foreach (XmlNode item in countryNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        countryIDRef = item.Attributes["id"].Name;
                        CountryCode ob = CountryCode();
                        IDManager.SetID(countryIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        countryIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        country = new CountryCode(item);
                    }
                }
            }


            XmlNodeList jurisdictionNodeList = xmlNode.SelectNodes("jurisdiction");

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


            XmlNodeList organizationTypeNodeList = xmlNode.SelectNodes("organizationType");

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

            foreach (XmlNode item in organizationTypeNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        organizationTypeIDRef = item.Attributes["id"].Name;
                        OrganizationType ob = OrganizationType();
                        IDManager.SetID(organizationTypeIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        organizationTypeIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        organizationType = new OrganizationType(item);
                    }
                }
            }


            XmlNodeList contactInfoNodeList = xmlNode.SelectNodes("contactInfo");

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

            foreach (XmlNode item in contactInfoNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        contactInfoIDRef = item.Attributes["id"].Name;
                        ContactInformation ob = ContactInformation();
                        IDManager.SetID(contactInfoIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        contactInfoIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        contactInfo = new ContactInformation(item);
                    }
                }
            }


            XmlNodeList businessUnitNodeList = xmlNode.SelectNodes("businessUnit");

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


            XmlNodeList personNodeList = xmlNode.SelectNodes("person");

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