public PaymentDates(XmlNode xmlNode)
 {
     XmlNode calculationPeriodDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodDatesReference");
     
     if (calculationPeriodDatesReferenceNode != null)
     {
         if (calculationPeriodDatesReferenceNode.Attributes["href"] != null || calculationPeriodDatesReferenceNode.Attributes["id"] != null) 
         {
             if (calculationPeriodDatesReferenceNode.Attributes["id"] != null) 
             {
                 calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["id"].Value;
                 CalculationPeriodDatesReference ob = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                 IDManager.SetID(calculationPeriodDatesReferenceIDRef_, ob);
             }
             else if (calculationPeriodDatesReferenceNode.Attributes["href"] != null)
             {
                 calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
             }
         }
         else
         {
             calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
         }
     }
     
 
     XmlNode resetDatesReferenceNode = xmlNode.SelectSingleNode("resetDatesReference");
     
     if (resetDatesReferenceNode != null)
     {
         if (resetDatesReferenceNode.Attributes["href"] != null || resetDatesReferenceNode.Attributes["id"] != null) 
         {
             if (resetDatesReferenceNode.Attributes["id"] != null) 
             {
                 resetDatesReferenceIDRef_ = resetDatesReferenceNode.Attributes["id"].Value;
                 ResetDatesReference ob = new ResetDatesReference(resetDatesReferenceNode);
                 IDManager.SetID(resetDatesReferenceIDRef_, ob);
             }
             else if (resetDatesReferenceNode.Attributes["href"] != null)
             {
                 resetDatesReferenceIDRef_ = resetDatesReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 resetDatesReference_ = new ResetDatesReference(resetDatesReferenceNode);
             }
         }
         else
         {
             resetDatesReference_ = new ResetDatesReference(resetDatesReferenceNode);
         }
     }
     
 
     XmlNode valuationDatesReferenceNode = xmlNode.SelectSingleNode("valuationDatesReference");
     
     if (valuationDatesReferenceNode != null)
     {
         if (valuationDatesReferenceNode.Attributes["href"] != null || valuationDatesReferenceNode.Attributes["id"] != null) 
         {
             if (valuationDatesReferenceNode.Attributes["id"] != null) 
             {
                 valuationDatesReferenceIDRef_ = valuationDatesReferenceNode.Attributes["id"].Value;
                 ValuationDatesReference ob = new ValuationDatesReference(valuationDatesReferenceNode);
                 IDManager.SetID(valuationDatesReferenceIDRef_, ob);
             }
             else if (valuationDatesReferenceNode.Attributes["href"] != null)
             {
                 valuationDatesReferenceIDRef_ = valuationDatesReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 valuationDatesReference_ = new ValuationDatesReference(valuationDatesReferenceNode);
             }
         }
         else
         {
             valuationDatesReference_ = new ValuationDatesReference(valuationDatesReferenceNode);
         }
     }
     
 
     XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");
     
     if (paymentFrequencyNode != null)
     {
         if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null) 
         {
             if (paymentFrequencyNode.Attributes["id"] != null) 
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                 Frequency ob = new Frequency(paymentFrequencyNode);
                 IDManager.SetID(paymentFrequencyIDRef_, ob);
             }
             else if (paymentFrequencyNode.Attributes["href"] != null)
             {
                 paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
             }
             else
             {
                 paymentFrequency_ = new Frequency(paymentFrequencyNode);
             }
         }
         else
         {
             paymentFrequency_ = new Frequency(paymentFrequencyNode);
         }
     }
     
 
     XmlNode firstPaymentDateNode = xmlNode.SelectSingleNode("firstPaymentDate");
     
     if (firstPaymentDateNode != null)
     {
         if (firstPaymentDateNode.Attributes["href"] != null || firstPaymentDateNode.Attributes["id"] != null) 
         {
             if (firstPaymentDateNode.Attributes["id"] != null) 
             {
                 firstPaymentDateIDRef_ = firstPaymentDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(firstPaymentDateNode);
                 IDManager.SetID(firstPaymentDateIDRef_, ob);
             }
             else if (firstPaymentDateNode.Attributes["href"] != null)
             {
                 firstPaymentDateIDRef_ = firstPaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 firstPaymentDate_ = new XsdTypeDate(firstPaymentDateNode);
             }
         }
         else
         {
             firstPaymentDate_ = new XsdTypeDate(firstPaymentDateNode);
         }
     }
     
 
     XmlNode lastRegularPaymentDateNode = xmlNode.SelectSingleNode("lastRegularPaymentDate");
     
     if (lastRegularPaymentDateNode != null)
     {
         if (lastRegularPaymentDateNode.Attributes["href"] != null || lastRegularPaymentDateNode.Attributes["id"] != null) 
         {
             if (lastRegularPaymentDateNode.Attributes["id"] != null) 
             {
                 lastRegularPaymentDateIDRef_ = lastRegularPaymentDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(lastRegularPaymentDateNode);
                 IDManager.SetID(lastRegularPaymentDateIDRef_, ob);
             }
             else if (lastRegularPaymentDateNode.Attributes["href"] != null)
             {
                 lastRegularPaymentDateIDRef_ = lastRegularPaymentDateNode.Attributes["href"].Value;
             }
             else
             {
                 lastRegularPaymentDate_ = new XsdTypeDate(lastRegularPaymentDateNode);
             }
         }
         else
         {
             lastRegularPaymentDate_ = new XsdTypeDate(lastRegularPaymentDateNode);
         }
     }
     
 
     XmlNode payRelativeToNode = xmlNode.SelectSingleNode("payRelativeTo");
     
     if (payRelativeToNode != null)
     {
         if (payRelativeToNode.Attributes["href"] != null || payRelativeToNode.Attributes["id"] != null) 
         {
             if (payRelativeToNode.Attributes["id"] != null) 
             {
                 payRelativeToIDRef_ = payRelativeToNode.Attributes["id"].Value;
                 PayRelativeToEnum ob = new PayRelativeToEnum(payRelativeToNode);
                 IDManager.SetID(payRelativeToIDRef_, ob);
             }
             else if (payRelativeToNode.Attributes["href"] != null)
             {
                 payRelativeToIDRef_ = payRelativeToNode.Attributes["href"].Value;
             }
             else
             {
                 payRelativeTo_ = new PayRelativeToEnum(payRelativeToNode);
             }
         }
         else
         {
             payRelativeTo_ = new PayRelativeToEnum(payRelativeToNode);
         }
     }
     
 
     XmlNode paymentDaysOffsetNode = xmlNode.SelectSingleNode("paymentDaysOffset");
     
     if (paymentDaysOffsetNode != null)
     {
         if (paymentDaysOffsetNode.Attributes["href"] != null || paymentDaysOffsetNode.Attributes["id"] != null) 
         {
             if (paymentDaysOffsetNode.Attributes["id"] != null) 
             {
                 paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["id"].Value;
                 Offset ob = new Offset(paymentDaysOffsetNode);
                 IDManager.SetID(paymentDaysOffsetIDRef_, ob);
             }
             else if (paymentDaysOffsetNode.Attributes["href"] != null)
             {
                 paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDaysOffset_ = new Offset(paymentDaysOffsetNode);
             }
         }
         else
         {
             paymentDaysOffset_ = new Offset(paymentDaysOffsetNode);
         }
     }
     
 
     XmlNode paymentDatesAdjustmentsNode = xmlNode.SelectSingleNode("paymentDatesAdjustments");
     
     if (paymentDatesAdjustmentsNode != null)
     {
         if (paymentDatesAdjustmentsNode.Attributes["href"] != null || paymentDatesAdjustmentsNode.Attributes["id"] != null) 
         {
             if (paymentDatesAdjustmentsNode.Attributes["id"] != null) 
             {
                 paymentDatesAdjustmentsIDRef_ = paymentDatesAdjustmentsNode.Attributes["id"].Value;
                 BusinessDayAdjustments ob = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
                 IDManager.SetID(paymentDatesAdjustmentsIDRef_, ob);
             }
             else if (paymentDatesAdjustmentsNode.Attributes["href"] != null)
             {
                 paymentDatesAdjustmentsIDRef_ = paymentDatesAdjustmentsNode.Attributes["href"].Value;
             }
             else
             {
                 paymentDatesAdjustments_ = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
             }
         }
         else
         {
             paymentDatesAdjustments_ = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
         }
     }
     
 
 }
Exemplo n.º 2
0
        public PaymentDates(XmlNode xmlNode)
        {
            XmlNodeList calculationPeriodDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodDatesReference");

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

            foreach (XmlNode item in calculationPeriodDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodDatesReference ob = CalculationPeriodDatesReference();
                        IDManager.SetID(calculationPeriodDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodDatesReference = new CalculationPeriodDatesReference(item);
                    }
                }
            }


            XmlNodeList resetDatesReferenceNodeList = xmlNode.SelectNodes("resetDatesReference");

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

            foreach (XmlNode item in resetDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        resetDatesReferenceIDRef = item.Attributes["id"].Name;
                        ResetDatesReference ob = ResetDatesReference();
                        IDManager.SetID(resetDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        resetDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        resetDatesReference = new ResetDatesReference(item);
                    }
                }
            }


            XmlNodeList valuationDatesReferenceNodeList = xmlNode.SelectNodes("valuationDatesReference");

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

            foreach (XmlNode item in valuationDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        valuationDatesReferenceIDRef = item.Attributes["id"].Name;
                        ValuationDatesReference ob = ValuationDatesReference();
                        IDManager.SetID(valuationDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        valuationDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        valuationDatesReference = new ValuationDatesReference(item);
                    }
                }
            }


            XmlNodeList paymentFrequencyNodeList = xmlNode.SelectNodes("paymentFrequency");

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

            foreach (XmlNode item in paymentFrequencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef = item.Attributes["id"].Name;
                        Frequency ob = Frequency();
                        IDManager.SetID(paymentFrequencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentFrequencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentFrequency = new Frequency(item);
                    }
                }
            }


            XmlNodeList firstPaymentDateNodeList = xmlNode.SelectNodes("firstPaymentDate");

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

            foreach (XmlNode item in firstPaymentDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        firstPaymentDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(firstPaymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        firstPaymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        firstPaymentDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList lastRegularPaymentDateNodeList = xmlNode.SelectNodes("lastRegularPaymentDate");

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

            foreach (XmlNode item in lastRegularPaymentDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        lastRegularPaymentDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(lastRegularPaymentDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        lastRegularPaymentDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        lastRegularPaymentDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList payRelativeToNodeList = xmlNode.SelectNodes("payRelativeTo");

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

            foreach (XmlNode item in payRelativeToNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        payRelativeToIDRef = item.Attributes["id"].Name;
                        PayRelativeToEnum ob = PayRelativeToEnum();
                        IDManager.SetID(payRelativeToIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        payRelativeToIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        payRelativeTo = new PayRelativeToEnum(item);
                    }
                }
            }


            XmlNodeList paymentDaysOffsetNodeList = xmlNode.SelectNodes("paymentDaysOffset");

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

            foreach (XmlNode item in paymentDaysOffsetNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDaysOffsetIDRef = item.Attributes["id"].Name;
                        Offset ob = Offset();
                        IDManager.SetID(paymentDaysOffsetIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDaysOffsetIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDaysOffset = new Offset(item);
                    }
                }
            }


            XmlNodeList paymentDatesAdjustmentsNodeList = xmlNode.SelectNodes("paymentDatesAdjustments");

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

            foreach (XmlNode item in paymentDatesAdjustmentsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        paymentDatesAdjustmentsIDRef = item.Attributes["id"].Name;
                        BusinessDayAdjustments ob = BusinessDayAdjustments();
                        IDManager.SetID(paymentDatesAdjustmentsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        paymentDatesAdjustmentsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        paymentDatesAdjustments = new BusinessDayAdjustments(item);
                    }
                }
            }
        }
        public PaymentDates(XmlNode xmlNode)
        {
            XmlNode calculationPeriodDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodDatesReference");

            if (calculationPeriodDatesReferenceNode != null)
            {
                if (calculationPeriodDatesReferenceNode.Attributes["href"] != null || calculationPeriodDatesReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodDatesReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["id"].Value;
                        CalculationPeriodDatesReference ob = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                        IDManager.SetID(calculationPeriodDatesReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodDatesReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                }
            }


            XmlNode resetDatesReferenceNode = xmlNode.SelectSingleNode("resetDatesReference");

            if (resetDatesReferenceNode != null)
            {
                if (resetDatesReferenceNode.Attributes["href"] != null || resetDatesReferenceNode.Attributes["id"] != null)
                {
                    if (resetDatesReferenceNode.Attributes["id"] != null)
                    {
                        resetDatesReferenceIDRef_ = resetDatesReferenceNode.Attributes["id"].Value;
                        ResetDatesReference ob = new ResetDatesReference(resetDatesReferenceNode);
                        IDManager.SetID(resetDatesReferenceIDRef_, ob);
                    }
                    else if (resetDatesReferenceNode.Attributes["href"] != null)
                    {
                        resetDatesReferenceIDRef_ = resetDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        resetDatesReference_ = new ResetDatesReference(resetDatesReferenceNode);
                    }
                }
                else
                {
                    resetDatesReference_ = new ResetDatesReference(resetDatesReferenceNode);
                }
            }


            XmlNode valuationDatesReferenceNode = xmlNode.SelectSingleNode("valuationDatesReference");

            if (valuationDatesReferenceNode != null)
            {
                if (valuationDatesReferenceNode.Attributes["href"] != null || valuationDatesReferenceNode.Attributes["id"] != null)
                {
                    if (valuationDatesReferenceNode.Attributes["id"] != null)
                    {
                        valuationDatesReferenceIDRef_ = valuationDatesReferenceNode.Attributes["id"].Value;
                        ValuationDatesReference ob = new ValuationDatesReference(valuationDatesReferenceNode);
                        IDManager.SetID(valuationDatesReferenceIDRef_, ob);
                    }
                    else if (valuationDatesReferenceNode.Attributes["href"] != null)
                    {
                        valuationDatesReferenceIDRef_ = valuationDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        valuationDatesReference_ = new ValuationDatesReference(valuationDatesReferenceNode);
                    }
                }
                else
                {
                    valuationDatesReference_ = new ValuationDatesReference(valuationDatesReferenceNode);
                }
            }


            XmlNode paymentFrequencyNode = xmlNode.SelectSingleNode("paymentFrequency");

            if (paymentFrequencyNode != null)
            {
                if (paymentFrequencyNode.Attributes["href"] != null || paymentFrequencyNode.Attributes["id"] != null)
                {
                    if (paymentFrequencyNode.Attributes["id"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["id"].Value;
                        Frequency ob = new Frequency(paymentFrequencyNode);
                        IDManager.SetID(paymentFrequencyIDRef_, ob);
                    }
                    else if (paymentFrequencyNode.Attributes["href"] != null)
                    {
                        paymentFrequencyIDRef_ = paymentFrequencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentFrequency_ = new Frequency(paymentFrequencyNode);
                    }
                }
                else
                {
                    paymentFrequency_ = new Frequency(paymentFrequencyNode);
                }
            }


            XmlNode firstPaymentDateNode = xmlNode.SelectSingleNode("firstPaymentDate");

            if (firstPaymentDateNode != null)
            {
                if (firstPaymentDateNode.Attributes["href"] != null || firstPaymentDateNode.Attributes["id"] != null)
                {
                    if (firstPaymentDateNode.Attributes["id"] != null)
                    {
                        firstPaymentDateIDRef_ = firstPaymentDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(firstPaymentDateNode);
                        IDManager.SetID(firstPaymentDateIDRef_, ob);
                    }
                    else if (firstPaymentDateNode.Attributes["href"] != null)
                    {
                        firstPaymentDateIDRef_ = firstPaymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        firstPaymentDate_ = new XsdTypeDate(firstPaymentDateNode);
                    }
                }
                else
                {
                    firstPaymentDate_ = new XsdTypeDate(firstPaymentDateNode);
                }
            }


            XmlNode lastRegularPaymentDateNode = xmlNode.SelectSingleNode("lastRegularPaymentDate");

            if (lastRegularPaymentDateNode != null)
            {
                if (lastRegularPaymentDateNode.Attributes["href"] != null || lastRegularPaymentDateNode.Attributes["id"] != null)
                {
                    if (lastRegularPaymentDateNode.Attributes["id"] != null)
                    {
                        lastRegularPaymentDateIDRef_ = lastRegularPaymentDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(lastRegularPaymentDateNode);
                        IDManager.SetID(lastRegularPaymentDateIDRef_, ob);
                    }
                    else if (lastRegularPaymentDateNode.Attributes["href"] != null)
                    {
                        lastRegularPaymentDateIDRef_ = lastRegularPaymentDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lastRegularPaymentDate_ = new XsdTypeDate(lastRegularPaymentDateNode);
                    }
                }
                else
                {
                    lastRegularPaymentDate_ = new XsdTypeDate(lastRegularPaymentDateNode);
                }
            }


            XmlNode payRelativeToNode = xmlNode.SelectSingleNode("payRelativeTo");

            if (payRelativeToNode != null)
            {
                if (payRelativeToNode.Attributes["href"] != null || payRelativeToNode.Attributes["id"] != null)
                {
                    if (payRelativeToNode.Attributes["id"] != null)
                    {
                        payRelativeToIDRef_ = payRelativeToNode.Attributes["id"].Value;
                        PayRelativeToEnum ob = new PayRelativeToEnum(payRelativeToNode);
                        IDManager.SetID(payRelativeToIDRef_, ob);
                    }
                    else if (payRelativeToNode.Attributes["href"] != null)
                    {
                        payRelativeToIDRef_ = payRelativeToNode.Attributes["href"].Value;
                    }
                    else
                    {
                        payRelativeTo_ = new PayRelativeToEnum(payRelativeToNode);
                    }
                }
                else
                {
                    payRelativeTo_ = new PayRelativeToEnum(payRelativeToNode);
                }
            }


            XmlNode paymentDaysOffsetNode = xmlNode.SelectSingleNode("paymentDaysOffset");

            if (paymentDaysOffsetNode != null)
            {
                if (paymentDaysOffsetNode.Attributes["href"] != null || paymentDaysOffsetNode.Attributes["id"] != null)
                {
                    if (paymentDaysOffsetNode.Attributes["id"] != null)
                    {
                        paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["id"].Value;
                        Offset ob = new Offset(paymentDaysOffsetNode);
                        IDManager.SetID(paymentDaysOffsetIDRef_, ob);
                    }
                    else if (paymentDaysOffsetNode.Attributes["href"] != null)
                    {
                        paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDaysOffset_ = new Offset(paymentDaysOffsetNode);
                    }
                }
                else
                {
                    paymentDaysOffset_ = new Offset(paymentDaysOffsetNode);
                }
            }


            XmlNode paymentDatesAdjustmentsNode = xmlNode.SelectSingleNode("paymentDatesAdjustments");

            if (paymentDatesAdjustmentsNode != null)
            {
                if (paymentDatesAdjustmentsNode.Attributes["href"] != null || paymentDatesAdjustmentsNode.Attributes["id"] != null)
                {
                    if (paymentDatesAdjustmentsNode.Attributes["id"] != null)
                    {
                        paymentDatesAdjustmentsIDRef_ = paymentDatesAdjustmentsNode.Attributes["id"].Value;
                        BusinessDayAdjustments ob = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
                        IDManager.SetID(paymentDatesAdjustmentsIDRef_, ob);
                    }
                    else if (paymentDatesAdjustmentsNode.Attributes["href"] != null)
                    {
                        paymentDatesAdjustmentsIDRef_ = paymentDatesAdjustmentsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        paymentDatesAdjustments_ = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
                    }
                }
                else
                {
                    paymentDatesAdjustments_ = new BusinessDayAdjustments(paymentDatesAdjustmentsNode);
                }
            }
        }