We can logically divide all uses into two big groups: 1) XML as a persistent mechanism and 2) XML as a mechanism to transfer transient data.
1. XML as a persistent mechanism .
In this category XML serves as an easy-to-use, cheap alternative to database. When you may prefer XML to database?
1) If you do not have huge amount of information. XML design goals include easy-to-use and all all all, but memory/performance optimization was not even mentioned. Even worse, memory/performance optimization was the price that was paid to achieve other design goals (like "human readability")
2) if you do not need extra services databases provide:
transactional integrity
security
authentication
concurrency control
developed search mechanism
multiple views
(Surprisingly enough

list of database virtues looks suspiciously similar to the list of XML proposed initiatives... security... authentication... XQuery as a search mechanism, XSLT as multiple view generators... Hm... In any case, databases are far more mature.)
One example of popular usage includes program configuration files, which are now often written in XML. Another example is representation of data on the WWW, where you can take advantage of XML ability to separate content from presentation. By applying different stylesheets, you can get differently formatted documents for several agents.
2. Transfer transient data.
XML becoming a popular high-level protocol in distributed computing. Such technologies as
SOAP or XML-RPC use XML as an underlying format for remote procedure calls. However, here I am leaving my area of competence and risk to get Michael Ernest (another moderator of this forum) sarcastic comments. If you manage to get his attention, he will tell you a lot of how "fat" XML protocols increase network traffic manifolds without any reasonable benefit.

Another example of high-level protocol that uses XML is
Jabber.
I have not seen a practical example of why I have to use it Here is Scott Bain's post in this forum that he later rework into a FAQ:
"I'll tell you some of the specific areas where I use it -- perhaps that will help.
I use XML to store configurational information for an application. For a server, for instance, I might store its IP address, root folder, handler application paths, etc...
I use XML to communicate over a network connection. For example, one of my clients needs to send complex information between an AS/400 and a Java application, using sockets. We structure this information in XML.
I use XML (via SOAP or XML-RPC) to create distributed objects, to make method calls to remote objects over a TCP/IP connection.
I use XML to control a project (the CDROM mentioned above). The slides, audio files, video components, etc... are all managed by an XML structure that defines what audio goes with what file, etc... then I use XSLT to translate this into a catalog page, javascript arrays for the actual tool, etc... If I need to move a slide, add a video clip, whatever, I just change the XML and re-run the transformations.
These are just some examples. As has been said elsewhere in this forum, XML is not a magic bullet, but a useful tool. I don't mark up huge amounts of data with it (I have not found a need for this). I use it primarily as a way to communicate between processes, and to control various activities within a process".
Areas where XML is most useful [ May 18, 2002: Message edited by: Mapraputa Is ]