Some fixes for xml creation