|Don't ask to ask, just ask|
Thanks Ambrus, I thought that was the case but I wanted to make sure I hadn't overlooked anything.
As I said, this is a legacy script I have inherited. Luckily the particular form of data does not occur often, so the user has agreed it is not worth a major rewrite of the code to accomodate it. As it is, it means occassionaly the validation script will raise a few warnings where actually the data is OK, but we can live with that.
In reply to Re^2: XML:: Twig - can you check for text following the element being handled?