Added xml creation. Far from perfect.