cpp: xerces: Improve raw pointer construction for Document and Element