lib/nlp: avoid crash when reading token XML