Added methods for saving to xml and csv format