Both use tags with that surround data. HTML formats a text file for humans to see. This is called rendering. XML looks like HTML but instead of rendering a file it carries information about the data in your file. XML allows you to define your own tags.
Tags contain information about the data they surround rather than specifying how it is to be seen.
With XML you can understand more about the information in the document plus, and this is key, a computer can too. It is difficult with so many people using different applications to exchange data without losing valuable information. For example a supplier in California might need to pass on information from its database to a vendor repeatedly. Information that is contained in a database interpreted by an application that the vendor is not using. By using XML the supplier can communicate the information the vendor needs without requiring expensive software solutions.