What was the reason to have XML files in [text] format ?
Because there were already many binary solutions to much the same
problems as XML, but no-one was using them. Implementing XML with text
makes it incomparably easier to work with and that's an enormous
SGML pre-dates XML, but that wasn't in widespread use either, being
seen as too complex (Berners-Lee had already rejected it, quite
rightly, in favour of HTML). Clearly something with a lower cost of
adoption was needed.
A "binary XML" would also not have been more efficient, in any way
that mattered. Disk space is cheap, programmer time is expensive.
Text-XML only needs to be in its "inefficient but readable" form when
you're actually working with it - for transmission we already have
enough compression down in the network stacks to take care of this.
Compression belong below the transport layer, not in the application!
There's also the similar issue of efficiency in element naming. Around
1999, when XML first started to surface commercially, there were
schemas that looked like this:
<AAA>
<ABC>123</ABC>
<ABB>def</ABB>
</AAA>
These schemas betray a major lack of understanding of XML, and discard
some of its best benefits.
XML was the synthesis of the decision to stick with text, the ability
to base much of it on SGML, and the target of integrating it with
HTML, that was already in use on more volume than any other single
format.