The Main Difference Between XML and HTML:
The single biggest weakness of HTML is its lack of extensibility, for instance in order to display a mathematical formula one had to use a different tool that produces a GIF image. Not only is this inconvenient, but all information about the formula, including the fact that it is a formula, are lost through this forced conversion.
This is where XML with its extensibility comes in. XML was used to define a standard for mathematical formulas called MathML, and many others for various subject areas. Some of those will be directly supported by browsers, others might be converted on the fly to a lower-level representation rather than manually converted. There is an XML formulation of HTML called XHTML.
XML was designed to carry data.
XML is not a replacement for HTML.
XML and HTML were designed with different goals:
XML was designed to describe data and to focus on what data is.
HTML was designed to display data and to focus on how data looks.
HTML is about displaying information, while XML is about describing information