code: private void writeCostRateTables(Project.Resources.Resource xml, Resource mpx)
     {
        //Rates rates = m_factory.createProjectResourcesResourceRates();
        //xml.setRates(rates);
        //List<Project.Resources.Resource.Rates.Rate> ratesList = rates.getRate();
  
        List<Project.Resources.Resource.Rates.Rate> ratesList = null;
  
        for (int tableIndex = 0; tableIndex < 5; tableIndex++)
        {
           CostRateTable table = mpx.getCostRateTable(tableIndex);
           if (table != null)
           {
              Date from = DateHelper.FIRST_DATE;
              for (CostRateTableEntry entry : table)
              {
                 if (costRateTableWriteRequired(entry, from))
                 {
                    if (ratesList == null)
                    {
                       Rates rates = m_factory.createProjectResourcesResourceRates();
                       xml.setRates(rates);
                       ratesList = rates.getRate();
                    }
  
                    Project.Resources.Resource.Rates.Rate rate = m_factory.createProjectResourcesResourceRatesRate();
                    ratesList.add(rate);
  
                    rate.setCostPerUse(DatatypeConverter.printCurrency(entry.getCostPerUse()));
                    rate.setOvertimeRate(DatatypeConverter.printRate(entry.getOvertimeRate()));
                    rate.setOvertimeRateFormat(DatatypeConverter.printTimeUnit(entry.getOvertimeRateFormat()));
                    rate.setRatesFrom(from);
                    from = entry.getEndDate();
                    rate.setRatesTo(from);
                    rate.setRateTable(BigInteger.valueOf(tableIndex));
                    rate.setStandardRate(DatatypeConverter.printRate(entry.getStandardRate()));
                    rate.setStandardRateFormat(DatatypeConverter.printTimeUnit(entry.getStandardRateFormat()));
                 }
              }
           }
        }
     }
docs: Writes a resource's cost rate tables.
  
  @param xml MSPDI resource
  @param mpx MPXJ resource