public BoundedVariance(XmlNode xmlNode)
 {
     XmlNode realisedVarianceMethodNode = xmlNode.SelectSingleNode("realisedVarianceMethod");
     
     if (realisedVarianceMethodNode != null)
     {
         if (realisedVarianceMethodNode.Attributes["href"] != null || realisedVarianceMethodNode.Attributes["id"] != null) 
         {
             if (realisedVarianceMethodNode.Attributes["id"] != null) 
             {
                 realisedVarianceMethodIDRef_ = realisedVarianceMethodNode.Attributes["id"].Value;
                 RealisedVarianceMethodEnum ob = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
                 IDManager.SetID(realisedVarianceMethodIDRef_, ob);
             }
             else if (realisedVarianceMethodNode.Attributes["href"] != null)
             {
                 realisedVarianceMethodIDRef_ = realisedVarianceMethodNode.Attributes["href"].Value;
             }
             else
             {
                 realisedVarianceMethod_ = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
             }
         }
         else
         {
             realisedVarianceMethod_ = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
         }
     }
     
 
     XmlNode daysInRangeAdjustmentNode = xmlNode.SelectSingleNode("daysInRangeAdjustment");
     
     if (daysInRangeAdjustmentNode != null)
     {
         if (daysInRangeAdjustmentNode.Attributes["href"] != null || daysInRangeAdjustmentNode.Attributes["id"] != null) 
         {
             if (daysInRangeAdjustmentNode.Attributes["id"] != null) 
             {
                 daysInRangeAdjustmentIDRef_ = daysInRangeAdjustmentNode.Attributes["id"].Value;
                 XsdTypeBoolean ob = new XsdTypeBoolean(daysInRangeAdjustmentNode);
                 IDManager.SetID(daysInRangeAdjustmentIDRef_, ob);
             }
             else if (daysInRangeAdjustmentNode.Attributes["href"] != null)
             {
                 daysInRangeAdjustmentIDRef_ = daysInRangeAdjustmentNode.Attributes["href"].Value;
             }
             else
             {
                 daysInRangeAdjustment_ = new XsdTypeBoolean(daysInRangeAdjustmentNode);
             }
         }
         else
         {
             daysInRangeAdjustment_ = new XsdTypeBoolean(daysInRangeAdjustmentNode);
         }
     }
     
 
     XmlNode upperBarrierNode = xmlNode.SelectSingleNode("upperBarrier");
     
     if (upperBarrierNode != null)
     {
         if (upperBarrierNode.Attributes["href"] != null || upperBarrierNode.Attributes["id"] != null) 
         {
             if (upperBarrierNode.Attributes["id"] != null) 
             {
                 upperBarrierIDRef_ = upperBarrierNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(upperBarrierNode);
                 IDManager.SetID(upperBarrierIDRef_, ob);
             }
             else if (upperBarrierNode.Attributes["href"] != null)
             {
                 upperBarrierIDRef_ = upperBarrierNode.Attributes["href"].Value;
             }
             else
             {
                 upperBarrier_ = new NonNegativeDecimal(upperBarrierNode);
             }
         }
         else
         {
             upperBarrier_ = new NonNegativeDecimal(upperBarrierNode);
         }
     }
     
 
     XmlNode lowerBarrierNode = xmlNode.SelectSingleNode("lowerBarrier");
     
     if (lowerBarrierNode != null)
     {
         if (lowerBarrierNode.Attributes["href"] != null || lowerBarrierNode.Attributes["id"] != null) 
         {
             if (lowerBarrierNode.Attributes["id"] != null) 
             {
                 lowerBarrierIDRef_ = lowerBarrierNode.Attributes["id"].Value;
                 NonNegativeDecimal ob = new NonNegativeDecimal(lowerBarrierNode);
                 IDManager.SetID(lowerBarrierIDRef_, ob);
             }
             else if (lowerBarrierNode.Attributes["href"] != null)
             {
                 lowerBarrierIDRef_ = lowerBarrierNode.Attributes["href"].Value;
             }
             else
             {
                 lowerBarrier_ = new NonNegativeDecimal(lowerBarrierNode);
             }
         }
         else
         {
             lowerBarrier_ = new NonNegativeDecimal(lowerBarrierNode);
         }
     }
     
 
 }
        public BoundedVariance(XmlNode xmlNode)
        {
            XmlNode realisedVarianceMethodNode = xmlNode.SelectSingleNode("realisedVarianceMethod");

            if (realisedVarianceMethodNode != null)
            {
                if (realisedVarianceMethodNode.Attributes["href"] != null || realisedVarianceMethodNode.Attributes["id"] != null)
                {
                    if (realisedVarianceMethodNode.Attributes["id"] != null)
                    {
                        realisedVarianceMethodIDRef_ = realisedVarianceMethodNode.Attributes["id"].Value;
                        RealisedVarianceMethodEnum ob = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
                        IDManager.SetID(realisedVarianceMethodIDRef_, ob);
                    }
                    else if (realisedVarianceMethodNode.Attributes["href"] != null)
                    {
                        realisedVarianceMethodIDRef_ = realisedVarianceMethodNode.Attributes["href"].Value;
                    }
                    else
                    {
                        realisedVarianceMethod_ = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
                    }
                }
                else
                {
                    realisedVarianceMethod_ = new RealisedVarianceMethodEnum(realisedVarianceMethodNode);
                }
            }


            XmlNode daysInRangeAdjustmentNode = xmlNode.SelectSingleNode("daysInRangeAdjustment");

            if (daysInRangeAdjustmentNode != null)
            {
                if (daysInRangeAdjustmentNode.Attributes["href"] != null || daysInRangeAdjustmentNode.Attributes["id"] != null)
                {
                    if (daysInRangeAdjustmentNode.Attributes["id"] != null)
                    {
                        daysInRangeAdjustmentIDRef_ = daysInRangeAdjustmentNode.Attributes["id"].Value;
                        XsdTypeBoolean ob = new XsdTypeBoolean(daysInRangeAdjustmentNode);
                        IDManager.SetID(daysInRangeAdjustmentIDRef_, ob);
                    }
                    else if (daysInRangeAdjustmentNode.Attributes["href"] != null)
                    {
                        daysInRangeAdjustmentIDRef_ = daysInRangeAdjustmentNode.Attributes["href"].Value;
                    }
                    else
                    {
                        daysInRangeAdjustment_ = new XsdTypeBoolean(daysInRangeAdjustmentNode);
                    }
                }
                else
                {
                    daysInRangeAdjustment_ = new XsdTypeBoolean(daysInRangeAdjustmentNode);
                }
            }


            XmlNode upperBarrierNode = xmlNode.SelectSingleNode("upperBarrier");

            if (upperBarrierNode != null)
            {
                if (upperBarrierNode.Attributes["href"] != null || upperBarrierNode.Attributes["id"] != null)
                {
                    if (upperBarrierNode.Attributes["id"] != null)
                    {
                        upperBarrierIDRef_ = upperBarrierNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(upperBarrierNode);
                        IDManager.SetID(upperBarrierIDRef_, ob);
                    }
                    else if (upperBarrierNode.Attributes["href"] != null)
                    {
                        upperBarrierIDRef_ = upperBarrierNode.Attributes["href"].Value;
                    }
                    else
                    {
                        upperBarrier_ = new NonNegativeDecimal(upperBarrierNode);
                    }
                }
                else
                {
                    upperBarrier_ = new NonNegativeDecimal(upperBarrierNode);
                }
            }


            XmlNode lowerBarrierNode = xmlNode.SelectSingleNode("lowerBarrier");

            if (lowerBarrierNode != null)
            {
                if (lowerBarrierNode.Attributes["href"] != null || lowerBarrierNode.Attributes["id"] != null)
                {
                    if (lowerBarrierNode.Attributes["id"] != null)
                    {
                        lowerBarrierIDRef_ = lowerBarrierNode.Attributes["id"].Value;
                        NonNegativeDecimal ob = new NonNegativeDecimal(lowerBarrierNode);
                        IDManager.SetID(lowerBarrierIDRef_, ob);
                    }
                    else if (lowerBarrierNode.Attributes["href"] != null)
                    {
                        lowerBarrierIDRef_ = lowerBarrierNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lowerBarrier_ = new NonNegativeDecimal(lowerBarrierNode);
                    }
                }
                else
                {
                    lowerBarrier_ = new NonNegativeDecimal(lowerBarrierNode);
                }
            }
        }
        public BoundedVariance(XmlNode xmlNode)
        {
            XmlNodeList realisedVarianceMethodNodeList = xmlNode.SelectNodes("realisedVarianceMethod");

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

            foreach (XmlNode item in realisedVarianceMethodNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        realisedVarianceMethodIDRef = item.Attributes["id"].Name;
                        RealisedVarianceMethodEnum ob = RealisedVarianceMethodEnum();
                        IDManager.SetID(realisedVarianceMethodIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        realisedVarianceMethodIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        realisedVarianceMethod = new RealisedVarianceMethodEnum(item);
                    }
                }
            }


            XmlNodeList daysInRangeAdjustmentNodeList = xmlNode.SelectNodes("daysInRangeAdjustment");

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

            foreach (XmlNode item in daysInRangeAdjustmentNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        daysInRangeAdjustmentIDRef = item.Attributes["id"].Name;
                        XsdTypeBoolean ob = XsdTypeBoolean();
                        IDManager.SetID(daysInRangeAdjustmentIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        daysInRangeAdjustmentIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        daysInRangeAdjustment = new XsdTypeBoolean(item);
                    }
                }
            }


            XmlNodeList upperBarrierNodeList = xmlNode.SelectNodes("upperBarrier");

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

            foreach (XmlNode item in upperBarrierNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        upperBarrierIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(upperBarrierIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        upperBarrierIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        upperBarrier = new NonNegativeDecimal(item);
                    }
                }
            }


            XmlNodeList lowerBarrierNodeList = xmlNode.SelectNodes("lowerBarrier");

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

            foreach (XmlNode item in lowerBarrierNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        lowerBarrierIDRef = item.Attributes["id"].Name;
                        NonNegativeDecimal ob = NonNegativeDecimal();
                        IDManager.SetID(lowerBarrierIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        lowerBarrierIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        lowerBarrier = new NonNegativeDecimal(item);
                    }
                }
            }
        }