I have a premonition that same code is copy/pasted in the XPKPackage::Create, isn't it? As I mentioned we should have only one factory method.