Getting Started Lesson 1 of 9
Introduction to XML
What XML is, how it differs from HTML, why it's used to store and exchange data, and where you meet XML every day.
XML was published by the W3C (the group behind web standards) in 1998. Its job is simple: describe data in a way that both humans and computers can read. HTML is for displaying content; XML is for storing and carrying data.
A first XML document
<?xml version="1.0" encoding="UTF-8"?>
<student>
<lrn>136728140001</lrn>
<name>Maria Clara Santos</name>
<grade>10</grade>
<section>Rizal</section>
</student>
Even without learning XML, you can read this: it's a student record. The tags describe what each piece of data means.
XML vs HTML
| HTML | XML | |
|---|---|---|
| Purpose | Display content in a browser | Store and exchange data |
| Tags | Fixed set (p, h1, img…) | You invent them (student, price…) |
| Rules | Forgiving: browsers fix many mistakes | Strict: one mistake makes the document invalid |
| Case | Not case-sensitive | Case-sensitive |
XML doesn't do anything by itself
An XML file is just structured text. It doesn't display nicely or calculate anything. Programs read it and decide what to do: show it in a table, import it into a database, or send it to another system. That's what makes XML so flexible.
Where you meet XML
- Sitemaps:
sitemap.xmltells Google which pages a website has. This site has one! - RSS feeds: news sites and podcasts publish updates as XML.
- SVG images: logos and icons drawn with XML tags.
- Office documents: a
.docxor.xlsxfile is actually a ZIP folder of XML files. - Android apps: screen layouts are written in XML.
- Data exchange: banks, e-commerce and government systems (for example electronic invoices) often send data as XML.
Viewing XML
Open an XML file in a browser like Chrome, and it shows the tree structure. Try visiting any website's /sitemap.xml. You can edit XML in any text editor; VS Code highlights it and can check for errors with an XML extension.
Quick Quiz
Check what you learned. Walang grade ito, practice lang. 🙂
By Sir Reyel · Last updated 2026-12-04