The main problem with XML is that writing a safe XML parser is difficult. But writing, say, a safe JSON parser is not much easier; writing a safe ASN.1 parser is much harder. So it's not clear whether there's a better possible declarative format.
There's always the issue of very deeply nested data structures causing lots of allocations, but no nested parser can avoid that.
Full featured XML parsers can read arbitrary files from disk, which is usually not what you want from a data interchange format.