OK zilansyed , I've got part of it using
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd">
<Header version="7.5" action="write" objectType="project" externalSource="NIKU"/>
<Projects>
<!-- create a new project from a template -->
<Project
fromTemplate = "te_2"
name = "zFromtemplate5"
projectID = "zFromtemplate5"
description = "zFromtemplate5"
managerResourceID = ""
start = "2016-06-01T00:00:00"
finish = "2016-12-01T00:00:00"
priority = "10"
progress = "1"
format = "11"
>
</Project>
<!-- create a new task to the above project -->
<Project
finish="2016-12-01T17:00:00"
name="zFromtemplate5"
projectID="zFromtemplate5"
start="2016-06-01T00:00:00" >
<Resources/>
<Tasks>
<Task
name="XOGed task 1"
orderID="1"
outlineLevel="1"
finish="2016-06-15T09:00:00"
start="2016-06-10T00:00:00"
taskID="x1">
<Assignments/>
<estimateRules/>
</Task>
</Tasks>
<Allocations/>
<scenarioDependencies/>
<InvestmentAssociations>
<Allocations/>
<Hierarchies/>
</InvestmentAssociations>
<General/>
<OBSAssocs complete="false"/>
</Project>
</Projects>
</NikuDataBus>
So I create a project from a template and the input file goes on with data from the project to be created adding a task to it.
What was the problem yesterday was that the key task defaults to false if the attribute is not present, but the filter in the task list defaults to true. I assume the task was there, but I did not see it because of the filter :-(
As you can see I have orderID="1" , but it is ignored and the new task will be added to the end.
If that is the case, then one way to do that would be to read the project, delete all the tasks and re-create them with the order you want. Does not sound like fun and I don't know if that can be done with XOG.