code: private Duration getDuration(Double duration)
     {
        Duration result = null;
  
        if (duration != null)
        {
           result = Duration.getInstance(NumberHelper.getDouble(duration), TimeUnit.HOURS);
        }
  
        return result;
     }
docs: Extracts a duration from a JAXBElement instance.
  
  @param duration duration expressed in hours
  @return duration instance