Added functionality to generate XML files