IDEX-1759: avoid ClassCastException when xml contains PROCESSING_INSTRUCTION element