code: private static void listHierarchy(ProjectFile file)
     {
        for (Task task : file.getChildTasks())
        {
           System.out.println("Task: " + task.getName() + "\t" + task.getStart() + "\t" + task.getFinish());
           listHierarchy(task, " ");
        }
  
        System.out.println();
     }
docs: This method lists all tasks defined in the file in a hierarchical
  format, reflecting the parent-child relationships between them.
  
  @param file MPX file