Fixed XML saving and loading

Signed-off-by: Pornpen Wonganusorn <pornpen.wong@gmail.com>