Since the 2003 version, I have always struggled with MS-Project XML files import.
Now I have to deal with MSP 2013 issues (Why Microsoft? Why is it so unpredictable?)
It seems to me that some basic information is needed in order to get the desired values correctly imported.
Here is what I do:
task.setEstimated(false); //to get rid of the percentage in the duration value
task.setPercentageComplete(50d); //50% for example
task.setPercentageWorkComplete(50d);
task.setPhysicalPercentComplete(50d);
task.setStart(<start date>);
task.setFinish(<finish date>);
task.setActualStart(<actual start date>);
task.setActualFinish(<actual finish date>); //only necessary if the task is 100%
task.setDuration(Duration.getInstance(4d, TimeUnit.DAYS)); //4d for example
task.setActualDuration(Duration.getInstance(2d, TimeUnit.DAYS));
double remainingDuration = task.getDuration().getDuration() - task.getActualDuration().getDuration();
task.setRemainingDuration(Duration.getInstance(remainingDuration, task.getDuration().getUnits()));
//if your task has resources assigned, you should set the work values
//suppose you have 2 resources assigned with 3 units each
double work = task.getDuration().getDuration() * 6;
task.setWork(Duration.getInstance(work, task.getDuration().getUnits()));
task.setRegularWork(work);
double actualWork = work * task.getPercentageComplete() / 100d;
task.setActualWork(Duration.getInstance(actualWork, task.getWork().getUnits()));
double remaining = task.getWork().getDuration() - task.getActualWork().getDuration();
task.setRemainingWork(Duration.getInstance(remaining, task.getWork().getUnits()));
Well, I believe this is enough.