Fix package creation issue

Reset the xml doc so that it is not reused when saving. We want a brand
new document.