Added fully working XML creation in stage 1