I've been using XML for over a decade and I disagree with your assessment..
"Uphill task"? The first time I used it, with a week's knowledge of it, I was
able to use it very effectively as a data format.
That's typical. At the level of "a week's experience", you can get
your own data in and out. The fact that XML is so accessible for use
as a data format is one big reason why it was so popular, so quickly.
The problem starts when you don't just try to manipulate your own data
by example, but when you need to identify a formal model for everyone
to do so. XML is badly restricted here by what it's even possible to
do (trees not generalised graphs, the universe of discourse being
limited to the document itself, what support there is for ID / IDREF
is scant) but it's also difficult to define what it is that XML does
with high precision and formal robustness (read the early drafts of
XML-Infoset).
XML evolved from some uses of SGML, and SGML is a document format that
_doesn't_ define a related data format. XML had to have this added to
it later, and it wasn't a clean-cut task. Going back about 10 years
and reading debates with Jukka and Arjun Ray would show some of the
limitations, Arjun's questions in particular.
XML is general purpose and semantically void. It is possible to use it for
any number of "well-defined data models".
We're inconsistent here in how we're using the term "data model" - the
usual problem of a technical discussion running out of dictionary
words. XML can certainly be used for any number of schemas (small S)
as can be defined by DTDs, XML Schema, Relax NG or informally. However
there also needs to be an underlying low-level model that is
consistent across all uses of XML (otherwise we can't interwork) and
this is where the problem is. It's not defined by the XML
specification, at the time the XML specification was written it wasn't
even defined anywhere. ad hoc assumption gets most projects up and
running internally, but it's not the same as a formal proof of
behaviour.