  Motivated by the recent observation that exponentially long coherence times
can be achieved for edge spins in models with strong zero modes, we study the
impact of level crossings in finite-length spin chains on the dynamics of the
edge spins. Focussing on the XY spin-1=2 chain with transverse or longitudinal
magnetic field, two models relevant to understand recent experimental results
on cobalt adatoms, we show that the edge spins can remain coherent for an
infinite time even for a finite-length chain if the magnetic field is tuned to
a value at which there is a level crossing. Furthermore, we show that the edge
spins remain coherent for any initial state for the integrable case of
transverse field because all states have level crossings at the same value of
the field, while the coherence time is increasingly large for lower
temperatures in the case of longitudinal field, which is non-integrable.
