XML save function , some tweak