Now saving xml and fixing javascript