Added functionality for exporting to XML