XML write working