Moved xml extension element merging to _getExtendedDocument().