What’s XML?

XML is a TLA (Three Letter Acronym) that stands for eXtensible Markup Language.  It’s essentially way to create a text file that’s both machine readable and human readable.  It’s probably one of the most successful ways to exchange data between different programs, different machines, and different operating systems that’s ever been put into real world use.  Almost all programs support XML now.

Below is an example of an XML file:


  1: xml version="1.0"?>
  2: <note>
  3:     <to>Johnto>
  4:     <from>Maryfrom>
  5:     <subject>Remindersubject>
  6:     <body>Meet me tomorrow at 12pm.body>
  7: note>

XML files are made of “tags”.  In the example above, the tags are surrounded with .  The text between the opening and closing tags is the data.  As you can see, this XML file represents some data object called a “note”.  Inside the note are 4 data items (to, from, subject, and body).  What makes XML extensible is that there are no pre-defined tags.  You make them up as you need them.  The only thing that’s important is that the program that creates the XML file and the program that reads the XML file both agree on the tags and how to handle them.

Even though there are no predefined tags in XML, there are formatting rules:

  • Any opening tag (like “” in the example above) must have a corresponding closing tag (“” in the example above).
  • Indentation doesn’t matter.
  • line breaks don’t matter (except for the data parts, possibly).

This article is not an XML tutorial, so I’ve not made any attempt to include the full list.  If you would like a complete description to implement XML in your own, custom software, w3 schools is an excellent resource.

Leave a Reply