SGML expresses this same constraint using a bunch of grammar engineering and some formal constraints. Which, at a formal level, is perhaps more elegant; but the results are awfully complex and hard to understand. XML's trick of having the processor insert extra spaces seems a bit ad-hoc, but it's at least easy to understand.
Copyright © 1998, Tim Bray. All rights reserved.