public ReferencePair(XmlNode xmlNode)
 {
     XmlNode referenceEntityNode = xmlNode.SelectSingleNode("referenceEntity");
     
     if (referenceEntityNode != null)
     {
         if (referenceEntityNode.Attributes["href"] != null || referenceEntityNode.Attributes["id"] != null) 
         {
             if (referenceEntityNode.Attributes["id"] != null) 
             {
                 referenceEntityIDRef_ = referenceEntityNode.Attributes["id"].Value;
                 LegalEntity ob = new LegalEntity(referenceEntityNode);
                 IDManager.SetID(referenceEntityIDRef_, ob);
             }
             else if (referenceEntityNode.Attributes["href"] != null)
             {
                 referenceEntityIDRef_ = referenceEntityNode.Attributes["href"].Value;
             }
             else
             {
                 referenceEntity_ = new LegalEntity(referenceEntityNode);
             }
         }
         else
         {
             referenceEntity_ = new LegalEntity(referenceEntityNode);
         }
     }
     
 
     XmlNode referenceObligationNode = xmlNode.SelectSingleNode("referenceObligation");
     
     if (referenceObligationNode != null)
     {
         if (referenceObligationNode.Attributes["href"] != null || referenceObligationNode.Attributes["id"] != null) 
         {
             if (referenceObligationNode.Attributes["id"] != null) 
             {
                 referenceObligationIDRef_ = referenceObligationNode.Attributes["id"].Value;
                 ReferenceObligation ob = new ReferenceObligation(referenceObligationNode);
                 IDManager.SetID(referenceObligationIDRef_, ob);
             }
             else if (referenceObligationNode.Attributes["href"] != null)
             {
                 referenceObligationIDRef_ = referenceObligationNode.Attributes["href"].Value;
             }
             else
             {
                 referenceObligation_ = new ReferenceObligation(referenceObligationNode);
             }
         }
         else
         {
             referenceObligation_ = new ReferenceObligation(referenceObligationNode);
         }
     }
     
 
     XmlNode noReferenceObligationNode = xmlNode.SelectSingleNode("noReferenceObligation");
     
     if (noReferenceObligationNode != null)
     {
         if (noReferenceObligationNode.Attributes["href"] != null || noReferenceObligationNode.Attributes["id"] != null) 
         {
             if (noReferenceObligationNode.Attributes["id"] != null) 
             {
                 noReferenceObligationIDRef_ = noReferenceObligationNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(noReferenceObligationNode);
                 IDManager.SetID(noReferenceObligationIDRef_, ob);
             }
             else if (noReferenceObligationNode.Attributes["href"] != null)
             {
                 noReferenceObligationIDRef_ = noReferenceObligationNode.Attributes["href"].Value;
             }
             else
             {
                 noReferenceObligation_ = new XsdTypeBoolean(noReferenceObligationNode);
             }
         }
         else
         {
             noReferenceObligation_ = new XsdTypeBoolean(noReferenceObligationNode);
         }
     }
     
 
     XmlNode entityTypeNode = xmlNode.SelectSingleNode("entityType");
     
     if (entityTypeNode != null)
     {
         if (entityTypeNode.Attributes["href"] != null || entityTypeNode.Attributes["id"] != null) 
         {
             if (entityTypeNode.Attributes["id"] != null) 
             {
                 entityTypeIDRef_ = entityTypeNode.Attributes["id"].Value;
                 EntityType ob = new EntityType(entityTypeNode);
                 IDManager.SetID(entityTypeIDRef_, ob);
             }
             else if (entityTypeNode.Attributes["href"] != null)
             {
                 entityTypeIDRef_ = entityTypeNode.Attributes["href"].Value;
             }
             else
             {
                 entityType_ = new EntityType(entityTypeNode);
             }
         }
         else
         {
             entityType_ = new EntityType(entityTypeNode);
         }
     }
     
 
 }
 public ReferencePair(XmlNode xmlNode)
 {
     XmlNodeList referenceEntityNodeList = xmlNode.SelectNodes("referenceEntity");
     if (referenceEntityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceEntityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceEntityIDRef = item.Attributes["id"].Name;
                 LegalEntity ob = LegalEntity();
                 IDManager.SetID(referenceEntityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceEntityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceEntity = new LegalEntity(item);
             }
         }
     }
     
 
     XmlNodeList referenceObligationNodeList = xmlNode.SelectNodes("referenceObligation");
     if (referenceObligationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in referenceObligationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 referenceObligationIDRef = item.Attributes["id"].Name;
                 ReferenceObligation ob = ReferenceObligation();
                 IDManager.SetID(referenceObligationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 referenceObligationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 referenceObligation = new ReferenceObligation(item);
             }
         }
     }
     
 
     XmlNodeList noReferenceObligationNodeList = xmlNode.SelectNodes("noReferenceObligation");
     if (noReferenceObligationNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in noReferenceObligationNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 noReferenceObligationIDRef = item.Attributes["id"].Name;
                 XsdTypeBoolean ob = XsdTypeBoolean();
                 IDManager.SetID(noReferenceObligationIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 noReferenceObligationIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 noReferenceObligation = new XsdTypeBoolean(item);
             }
         }
     }
     
 
     XmlNodeList entityTypeNodeList = xmlNode.SelectNodes("entityType");
     if (entityTypeNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in entityTypeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 entityTypeIDRef = item.Attributes["id"].Name;
                 EntityType ob = EntityType();
                 IDManager.SetID(entityTypeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 entityTypeIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 entityType = new EntityType(item);
             }
         }
     }
     
 
 }