This is the xml document that I'm testing against.
<c>B<i>C</i>X</c>
(//*/text())[2]
returns "C" which appears to be what other engines return.
However,
fn:concat('[',(//*/text())[2],']')
returns "[X]" which is unexpected (and inconsistent).
Similarly, I tested fn:substring-before(), fn:substring-after(), and others with the same results.