Fix bug in encodeBinaryXmlKeyLocator for checking type.