Fix leaks in XMLimport.
Merge branch 'release_31' into development

Fix leaks in XMLimport.