Making xml creation generic