Generate final xml