Fix leaks in XMLimport.
Fix memory leaks.