added save to XML functionality.