Added xml support

old saving function is implemented but does not work. Sharing works