public MetalPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNodeList metalNodeList = xmlNode.SelectNodes("metal");

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

            foreach (XmlNode item in metalNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        metalIDRef = item.Attributes["id"].Name;
                        Metal ob = Metal();
                        IDManager.SetID(metalIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        metalIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        metal = new Metal(item);
                    }
                }
            }


            XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");

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

            foreach (XmlNode item in deliveryPeriodsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef = item.Attributes["id"].Name;
                        CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                        IDManager.SetID(deliveryPeriodsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryPeriodsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryPeriods = new CommodityDeliveryPeriods(item);
                    }
                }
            }


            XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");

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

            foreach (XmlNode item in deliveryConditionsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef = item.Attributes["id"].Name;
                        MetalDelivery ob = MetalDelivery();
                        IDManager.SetID(deliveryConditionsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        deliveryConditionsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        deliveryConditions = new MetalDelivery(item);
                    }
                }
            }


            XmlNodeList physicalQuantityNodeList = xmlNode.SelectNodes("physicalQuantity");

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

            foreach (XmlNode item in physicalQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalQuantityIDRef = item.Attributes["id"].Name;
                        CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                        IDManager.SetID(physicalQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalQuantity = new CommodityNotionalQuantity(item);
                    }
                }
            }


            XmlNodeList physicalQuantityScheduleNodeList = xmlNode.SelectNodes("physicalQuantitySchedule");

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

            foreach (XmlNode item in physicalQuantityScheduleNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        physicalQuantityScheduleIDRef = item.Attributes["id"].Name;
                        CommodityPhysicalQuantitySchedule ob = CommodityPhysicalQuantitySchedule();
                        IDManager.SetID(physicalQuantityScheduleIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        physicalQuantityScheduleIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        physicalQuantitySchedule = new CommodityPhysicalQuantitySchedule(item);
                    }
                }
            }


            XmlNodeList totalPhysicalQuantityNodeList = xmlNode.SelectNodes("totalPhysicalQuantity");

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

            foreach (XmlNode item in totalPhysicalQuantityNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        totalPhysicalQuantityIDRef = item.Attributes["id"].Name;
                        UnitQuantity ob = UnitQuantity();
                        IDManager.SetID(totalPhysicalQuantityIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        totalPhysicalQuantityIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        totalPhysicalQuantity = new UnitQuantity(item);
                    }
                }
            }


            XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");

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

            foreach (XmlNode item in conversionFactorNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        conversionFactorIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(conversionFactorIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        conversionFactorIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        conversionFactor = new XsdTypeDecimal(item);
                    }
                }
            }
        }
 public MetalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNodeList metalNodeList = xmlNode.SelectNodes("metal");
     if (metalNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in metalNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 metalIDRef = item.Attributes["id"].Name;
                 Metal ob = Metal();
                 IDManager.SetID(metalIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 metalIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 metal = new Metal(item);
             }
         }
     }
     
 
     XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods");
     if (deliveryPeriodsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryPeriodsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef = item.Attributes["id"].Name;
                 CommodityDeliveryPeriods ob = CommodityDeliveryPeriods();
                 IDManager.SetID(deliveryPeriodsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryPeriodsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryPeriods = new CommodityDeliveryPeriods(item);
             }
         }
     }
     
 
     XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions");
     if (deliveryConditionsNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in deliveryConditionsNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef = item.Attributes["id"].Name;
                 MetalDelivery ob = MetalDelivery();
                 IDManager.SetID(deliveryConditionsIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 deliveryConditionsIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 deliveryConditions = new MetalDelivery(item);
             }
         }
     }
     
 
     XmlNodeList physicalQuantityNodeList = xmlNode.SelectNodes("physicalQuantity");
     if (physicalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalQuantityIDRef = item.Attributes["id"].Name;
                 CommodityNotionalQuantity ob = CommodityNotionalQuantity();
                 IDManager.SetID(physicalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalQuantity = new CommodityNotionalQuantity(item);
             }
         }
     }
     
 
     XmlNodeList physicalQuantityScheduleNodeList = xmlNode.SelectNodes("physicalQuantitySchedule");
     if (physicalQuantityScheduleNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in physicalQuantityScheduleNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 physicalQuantityScheduleIDRef = item.Attributes["id"].Name;
                 CommodityPhysicalQuantitySchedule ob = CommodityPhysicalQuantitySchedule();
                 IDManager.SetID(physicalQuantityScheduleIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 physicalQuantityScheduleIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 physicalQuantitySchedule = new CommodityPhysicalQuantitySchedule(item);
             }
         }
     }
     
 
     XmlNodeList totalPhysicalQuantityNodeList = xmlNode.SelectNodes("totalPhysicalQuantity");
     if (totalPhysicalQuantityNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in totalPhysicalQuantityNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 totalPhysicalQuantityIDRef = item.Attributes["id"].Name;
                 UnitQuantity ob = UnitQuantity();
                 IDManager.SetID(totalPhysicalQuantityIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 totalPhysicalQuantityIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 totalPhysicalQuantity = new UnitQuantity(item);
             }
         }
     }
     
 
     XmlNodeList conversionFactorNodeList = xmlNode.SelectNodes("conversionFactor");
     if (conversionFactorNodeList.Count > 1 )
     {
             throw new Exception();
     }
     
     foreach (XmlNode item in conversionFactorNodeList)
     {
         if (item.Attributes["href"] != null || item.Attributes["id"] == null) 
         {
             if (item.Attributes["id"] != null) 
             {
                 conversionFactorIDRef = item.Attributes["id"].Name;
                 XsdTypeDecimal ob = XsdTypeDecimal();
                 IDManager.SetID(conversionFactorIDRef, ob);
             }
             else if (item.Attributes.ToString() == "href")
             {
                 conversionFactorIDRef = item.Attributes["href"].Name;
             }
             else
             {
                 conversionFactor = new XsdTypeDecimal(item);
             }
         }
     }
     
 
 }
 public MetalPhysicalLeg(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode metalNode = xmlNode.SelectSingleNode("metal");
     
     if (metalNode != null)
     {
         if (metalNode.Attributes["href"] != null || metalNode.Attributes["id"] != null) 
         {
             if (metalNode.Attributes["id"] != null) 
             {
                 metalIDRef_ = metalNode.Attributes["id"].Value;
                 Metal ob = new Metal(metalNode);
                 IDManager.SetID(metalIDRef_, ob);
             }
             else if (metalNode.Attributes["href"] != null)
             {
                 metalIDRef_ = metalNode.Attributes["href"].Value;
             }
             else
             {
                 metal_ = new Metal(metalNode);
             }
         }
         else
         {
             metal_ = new Metal(metalNode);
         }
     }
     
 
     XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");
     
     if (deliveryPeriodsNode != null)
     {
         if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null) 
         {
             if (deliveryPeriodsNode.Attributes["id"] != null) 
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                 CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                 IDManager.SetID(deliveryPeriodsIDRef_, ob);
             }
             else if (deliveryPeriodsNode.Attributes["href"] != null)
             {
                 deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
             }
         }
         else
         {
             deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
         }
     }
     
 
     XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");
     
     if (deliveryConditionsNode != null)
     {
         if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null) 
         {
             if (deliveryConditionsNode.Attributes["id"] != null) 
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                 MetalDelivery ob = new MetalDelivery(deliveryConditionsNode);
                 IDManager.SetID(deliveryConditionsIDRef_, ob);
             }
             else if (deliveryConditionsNode.Attributes["href"] != null)
             {
                 deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
             }
             else
             {
                 deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
             }
         }
         else
         {
             deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
         }
     }
     
 
     XmlNode physicalQuantityNode = xmlNode.SelectSingleNode("physicalQuantity");
     
     if (physicalQuantityNode != null)
     {
         if (physicalQuantityNode.Attributes["href"] != null || physicalQuantityNode.Attributes["id"] != null) 
         {
             if (physicalQuantityNode.Attributes["id"] != null) 
             {
                 physicalQuantityIDRef_ = physicalQuantityNode.Attributes["id"].Value;
                 CommodityNotionalQuantity ob = new CommodityNotionalQuantity(physicalQuantityNode);
                 IDManager.SetID(physicalQuantityIDRef_, ob);
             }
             else if (physicalQuantityNode.Attributes["href"] != null)
             {
                 physicalQuantityIDRef_ = physicalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
             }
         }
         else
         {
             physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
         }
     }
     
 
     XmlNode physicalQuantityScheduleNode = xmlNode.SelectSingleNode("physicalQuantitySchedule");
     
     if (physicalQuantityScheduleNode != null)
     {
         if (physicalQuantityScheduleNode.Attributes["href"] != null || physicalQuantityScheduleNode.Attributes["id"] != null) 
         {
             if (physicalQuantityScheduleNode.Attributes["id"] != null) 
             {
                 physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["id"].Value;
                 CommodityPhysicalQuantitySchedule ob = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                 IDManager.SetID(physicalQuantityScheduleIDRef_, ob);
             }
             else if (physicalQuantityScheduleNode.Attributes["href"] != null)
             {
                 physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["href"].Value;
             }
             else
             {
                 physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
             }
         }
         else
         {
             physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
         }
     }
     
 
     XmlNode totalPhysicalQuantityNode = xmlNode.SelectSingleNode("totalPhysicalQuantity");
     
     if (totalPhysicalQuantityNode != null)
     {
         if (totalPhysicalQuantityNode.Attributes["href"] != null || totalPhysicalQuantityNode.Attributes["id"] != null) 
         {
             if (totalPhysicalQuantityNode.Attributes["id"] != null) 
             {
                 totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["id"].Value;
                 UnitQuantity ob = new UnitQuantity(totalPhysicalQuantityNode);
                 IDManager.SetID(totalPhysicalQuantityIDRef_, ob);
             }
             else if (totalPhysicalQuantityNode.Attributes["href"] != null)
             {
                 totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["href"].Value;
             }
             else
             {
                 totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
             }
         }
         else
         {
             totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
         }
     }
     
 
     XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");
     
     if (conversionFactorNode != null)
     {
         if (conversionFactorNode.Attributes["href"] != null || conversionFactorNode.Attributes["id"] != null) 
         {
             if (conversionFactorNode.Attributes["id"] != null) 
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(conversionFactorNode);
                 IDManager.SetID(conversionFactorIDRef_, ob);
             }
             else if (conversionFactorNode.Attributes["href"] != null)
             {
                 conversionFactorIDRef_ = conversionFactorNode.Attributes["href"].Value;
             }
             else
             {
                 conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
             }
         }
         else
         {
             conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
         }
     }
     
 
 }
        public MetalPhysicalLeg(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode metalNode = xmlNode.SelectSingleNode("metal");

            if (metalNode != null)
            {
                if (metalNode.Attributes["href"] != null || metalNode.Attributes["id"] != null)
                {
                    if (metalNode.Attributes["id"] != null)
                    {
                        metalIDRef_ = metalNode.Attributes["id"].Value;
                        Metal ob = new Metal(metalNode);
                        IDManager.SetID(metalIDRef_, ob);
                    }
                    else if (metalNode.Attributes["href"] != null)
                    {
                        metalIDRef_ = metalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        metal_ = new Metal(metalNode);
                    }
                }
                else
                {
                    metal_ = new Metal(metalNode);
                }
            }


            XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods");

            if (deliveryPeriodsNode != null)
            {
                if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null)
                {
                    if (deliveryPeriodsNode.Attributes["id"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value;
                        CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                        IDManager.SetID(deliveryPeriodsIDRef_, ob);
                    }
                    else if (deliveryPeriodsNode.Attributes["href"] != null)
                    {
                        deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                    }
                }
                else
                {
                    deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode);
                }
            }


            XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions");

            if (deliveryConditionsNode != null)
            {
                if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null)
                {
                    if (deliveryConditionsNode.Attributes["id"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value;
                        MetalDelivery ob = new MetalDelivery(deliveryConditionsNode);
                        IDManager.SetID(deliveryConditionsIDRef_, ob);
                    }
                    else if (deliveryConditionsNode.Attributes["href"] != null)
                    {
                        deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
                    }
                }
                else
                {
                    deliveryConditions_ = new MetalDelivery(deliveryConditionsNode);
                }
            }


            XmlNode physicalQuantityNode = xmlNode.SelectSingleNode("physicalQuantity");

            if (physicalQuantityNode != null)
            {
                if (physicalQuantityNode.Attributes["href"] != null || physicalQuantityNode.Attributes["id"] != null)
                {
                    if (physicalQuantityNode.Attributes["id"] != null)
                    {
                        physicalQuantityIDRef_ = physicalQuantityNode.Attributes["id"].Value;
                        CommodityNotionalQuantity ob = new CommodityNotionalQuantity(physicalQuantityNode);
                        IDManager.SetID(physicalQuantityIDRef_, ob);
                    }
                    else if (physicalQuantityNode.Attributes["href"] != null)
                    {
                        physicalQuantityIDRef_ = physicalQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
                    }
                }
                else
                {
                    physicalQuantity_ = new CommodityNotionalQuantity(physicalQuantityNode);
                }
            }


            XmlNode physicalQuantityScheduleNode = xmlNode.SelectSingleNode("physicalQuantitySchedule");

            if (physicalQuantityScheduleNode != null)
            {
                if (physicalQuantityScheduleNode.Attributes["href"] != null || physicalQuantityScheduleNode.Attributes["id"] != null)
                {
                    if (physicalQuantityScheduleNode.Attributes["id"] != null)
                    {
                        physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["id"].Value;
                        CommodityPhysicalQuantitySchedule ob = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                        IDManager.SetID(physicalQuantityScheduleIDRef_, ob);
                    }
                    else if (physicalQuantityScheduleNode.Attributes["href"] != null)
                    {
                        physicalQuantityScheduleIDRef_ = physicalQuantityScheduleNode.Attributes["href"].Value;
                    }
                    else
                    {
                        physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                    }
                }
                else
                {
                    physicalQuantitySchedule_ = new CommodityPhysicalQuantitySchedule(physicalQuantityScheduleNode);
                }
            }


            XmlNode totalPhysicalQuantityNode = xmlNode.SelectSingleNode("totalPhysicalQuantity");

            if (totalPhysicalQuantityNode != null)
            {
                if (totalPhysicalQuantityNode.Attributes["href"] != null || totalPhysicalQuantityNode.Attributes["id"] != null)
                {
                    if (totalPhysicalQuantityNode.Attributes["id"] != null)
                    {
                        totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["id"].Value;
                        UnitQuantity ob = new UnitQuantity(totalPhysicalQuantityNode);
                        IDManager.SetID(totalPhysicalQuantityIDRef_, ob);
                    }
                    else if (totalPhysicalQuantityNode.Attributes["href"] != null)
                    {
                        totalPhysicalQuantityIDRef_ = totalPhysicalQuantityNode.Attributes["href"].Value;
                    }
                    else
                    {
                        totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
                    }
                }
                else
                {
                    totalPhysicalQuantity_ = new UnitQuantity(totalPhysicalQuantityNode);
                }
            }


            XmlNode conversionFactorNode = xmlNode.SelectSingleNode("conversionFactor");

            if (conversionFactorNode != null)
            {
                if (conversionFactorNode.Attributes["href"] != null || conversionFactorNode.Attributes["id"] != null)
                {
                    if (conversionFactorNode.Attributes["id"] != null)
                    {
                        conversionFactorIDRef_ = conversionFactorNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(conversionFactorNode);
                        IDManager.SetID(conversionFactorIDRef_, ob);
                    }
                    else if (conversionFactorNode.Attributes["href"] != null)
                    {
                        conversionFactorIDRef_ = conversionFactorNode.Attributes["href"].Value;
                    }
                    else
                    {
                        conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
                    }
                }
                else
                {
                    conversionFactor_ = new XsdTypeDecimal(conversionFactorNode);
                }
            }
        }