Hi Martin,
Many thanks for the feedback. The original code works for the Arduino Uno and I don’t know why it can’t be compiled for the esp8266. I took the code to convert an XString to a C string from here:
https://forum.xod.io/t/convert-xstring-or-list-char-to-char/1495
Hopefully one of the more experienced members of the forum will be able to offer advice.