felgall essentially explained the uses for it. The concept is that XML is a text-based data storage method. You can use whatever markup you want:
<item invNumber="38C-192" name="Lid - 32oz Coffee">
<description>Lids for 32oz coffee cups</description>
<item invNumber="08N-231" name="Napkins - White">
<description>8oz pkg. of white pre-folded napkins</description>
Simple, right? Elements or attributes, it doesn't matter. They could have been done just as easily either way. Sometimes it makes more sense to use one instead of the other, but occasionally the choice isn't terribly easy.
You can define a grammar using an XML DTD, an XML Schema, a Relax NG schema, or any combination thereof, so that any document created using that format must conform specifically to that grammar.
You can transform it into HTML, XML, XHTML or possibly even a simple text format like CSV using XSLT documents.
You can still style it using CSS as well.
I will say that XML languages are not programming languages, per se, like PHP or C++ are. Things like XPath are simply tools used to aid in the programming aspect of using the XML document. XSLT is simply an XML-based grammar used to manipulate the way XML should be rendered.