XML write functionality complete