If they're all <a> then you're back to square one.
JSON solves this with indentation, pretty printing, and using paired symbols that most conpetent editors can automatically balance. This solves the homogeneous case too.
Incidentally, XML can benefit from the first two, and many editors balance tags, so you can get the same thing there.