better handling of xml save and load