public Metal(XmlNode xmlNode)
 {
     XmlNode materialNode = xmlNode.SelectSingleNode("material");
     
     if (materialNode != null)
     {
         if (materialNode.Attributes["href"] != null || materialNode.Attributes["id"] != null) 
         {
             if (materialNode.Attributes["id"] != null) 
             {
                 materialIDRef_ = materialNode.Attributes["id"].Value;
                 Material ob = new Material(materialNode);
                 IDManager.SetID(materialIDRef_, ob);
             }
             else if (materialNode.Attributes["href"] != null)
             {
                 materialIDRef_ = materialNode.Attributes["href"].Value;
             }
             else
             {
                 material_ = new Material(materialNode);
             }
         }
         else
         {
             material_ = new Material(materialNode);
         }
     }
     
 
     XmlNodeList shapeNodeList = xmlNode.SelectNodes("shape");
     
     if (shapeNodeList != null)
     {
         this.shape_ = new List<CommodityMetalShape>();
         foreach (XmlNode item in shapeNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     shapeIDRef_ = item.Attributes["id"].Value;
                     shape_.Add(new CommodityMetalShape(item));
                     IDManager.SetID(shapeIDRef_, shape_[shape_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     shapeIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 shape_.Add(new CommodityMetalShape(item));
                 }
             }
             else
             {
                 shape_.Add(new CommodityMetalShape(item));
             }
         }
     }
     
 
     XmlNodeList brandNodeList = xmlNode.SelectNodes("brand");
     
     if (brandNodeList != null)
     {
         this.brand_ = new List<CommodityMetalBrand>();
         foreach (XmlNode item in brandNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     brandIDRef_ = item.Attributes["id"].Value;
                     brand_.Add(new CommodityMetalBrand(item));
                     IDManager.SetID(brandIDRef_, brand_[brand_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     brandIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 brand_.Add(new CommodityMetalBrand(item));
                 }
             }
             else
             {
                 brand_.Add(new CommodityMetalBrand(item));
             }
         }
     }
     
 
     XmlNodeList gradeNodeList = xmlNode.SelectNodes("grade");
     
     if (gradeNodeList != null)
     {
         this.grade_ = new List<CommodityMetalGrade>();
         foreach (XmlNode item in gradeNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     gradeIDRef_ = item.Attributes["id"].Value;
                     grade_.Add(new CommodityMetalGrade(item));
                     IDManager.SetID(gradeIDRef_, grade_[grade_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     gradeIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 grade_.Add(new CommodityMetalGrade(item));
                 }
             }
             else
             {
                 grade_.Add(new CommodityMetalGrade(item));
             }
         }
     }
     
 
 }
 public Metal(XmlNode xmlNode)
 {
     XmlNodeList materialNodeList = xmlNode.SelectNodes("material");
     if (materialNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in materialNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 materialIDRef = item.Attributes["id"].Name;
                 Material ob = Material();
                 IDManager.SetID(materialIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 materialIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 material = new Material(item);
             }
         }
     }
     
 
     XmlNodeList shapeNodeList = xmlNode.SelectNodes("shape");
     
     foreach (XmlNode item in shapeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 shapeIDRef = item.Attributes["id"].Name;
                 List<CommodityMetalShape> ob = new List<CommodityMetalShape>();
                 ob.Add(new CommodityMetalShape(item));
                 IDManager.SetID(shapeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 shapeIDRef = item.Attributes["href"].Name;
             }
             else
             {
             shape.Add(new CommodityMetalShape(item));
             }
         }
     }
     
 
     XmlNodeList brandNodeList = xmlNode.SelectNodes("brand");
     
     foreach (XmlNode item in brandNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 brandIDRef = item.Attributes["id"].Name;
                 List<CommodityMetalBrand> ob = new List<CommodityMetalBrand>();
                 ob.Add(new CommodityMetalBrand(item));
                 IDManager.SetID(brandIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 brandIDRef = item.Attributes["href"].Name;
             }
             else
             {
             brand.Add(new CommodityMetalBrand(item));
             }
         }
     }
     
 
     XmlNodeList gradeNodeList = xmlNode.SelectNodes("grade");
     
     foreach (XmlNode item in gradeNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 gradeIDRef = item.Attributes["id"].Name;
                 List<CommodityMetalGrade> ob = new List<CommodityMetalGrade>();
                 ob.Add(new CommodityMetalGrade(item));
                 IDManager.SetID(gradeIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 gradeIDRef = item.Attributes["href"].Name;
             }
             else
             {
             grade.Add(new CommodityMetalGrade(item));
             }
         }
     }
     
 
 }