Added error-handling when unable to generate XML