code: private void writeTask(Task task)
     {
        if (!task.getNull())
        {
           if (extractAndConvertTaskType(task) == null || task.getSummary())
           {
              writeWBS(task);
           }
           else
           {
              writeActivity(task);
           }
        }
     }
docs: Given a Task instance, this task determines if it should be written to the
  PM XML file as an activity or as a WBS item, and calls the appropriate
  method.
  
  @param task Task instance