---
title: "Short note: XML"
subject: "Internet and Intranet"
chapter: 6
key: "semester_8/internet_and_intranet:note-xml"
source: https://www.bctengineer.com/q/semester_8/internet_and_intranet/note-xml
site: BCT Engineering
---

# Short note: XML

Internet and Intranet · Chapter 6: Internet and Intranet Systems Development

- Asked in: 2072 Magh, 4 marks
- Video: [XML Tutorial for Beginners | What is XML | Learn XML](https://www.youtube.com/watch?v=KeLiQXqVgMI) — Clever Techie
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/internet_and_intranet/note-xml
- Whole chapter: https://www.bctengineer.com/md/semester_8/internet_and_intranet/chapter-6

## Question

Write a short note on XML.

## Short answer

XML is an extensible W3C markup language that describes data using user-defined tags, with strict well-formed syntax and validation via DTD or Schema. It is platform-independent and used for data exchange, configuration and AJAX, though more verbose and slower to parse than JSON.

## Answer

**XML (eXtensible Markup Language)** is a W3C standard markup language for describing and carrying data. Unlike HTML, which defines how data is displayed, XML defines what the data is. Users create their own tags, so it is "extensible".

#### Features

- Self-describing, text-based and platform independent.
- Strict syntax: one root element, every tag closed, correct nesting, case sensitive, attribute values in quotes. A document that follows this is **well-formed**.
- A document can be checked against a **DTD** or **XML Schema (XSD)**; then it is **valid**.
- Display can be separated from data using **CSS** or **XSLT**.
- Parsed using DOM or SAX.

#### Example

```xml
<?xml version="1.0"?>
<student id="101">
  <name>Sita Sharma</name>
  <semester>8</semester>
  <subject>Internet and Intranet</subject>
</student>
```

#### Uses

- Data exchange between different systems (web services, SOAP).
- Configuration files, RSS/Atom feeds, SVG, office documents.
- Together with JavaScript in AJAX.

#### Advantages and limits

- Easy to read, flexible, supports Unicode, and works on any platform.
- Verbose compared with JSON, and parsing is slower for large files.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How does XML differ from HTML?
   A. XML describes what the data is, HTML defines how it is displayed
   B. XML defines display and HTML describes data
   C. XML has fixed tags only
   D. They are identical
   Answer: A. XML is for describing and carrying data and users define their own tags. (Key point: XML vs HTML)

2. Which rule is needed for a well-formed XML document?
   A. One root element, every tag closed, correct nesting, quoted attribute values
   B. Tags may overlap
   C. Tag names are case-insensitive
   D. No root element is required
   Answer: A. XML syntax is strict: one root, closed and properly nested tags, case sensitive, quoted attributes. (Key point: Well-formed)

3. When is an XML document called valid?
   A. When it conforms to a DTD or XML Schema
   B. When it has no tags
   C. When it is displayed in a browser
   D. When it is short
   Answer: A. Valid means checked against a DTD or XSD; well-formed refers only to syntax. (Key point: Valid document)

4. How can the display be separated from XML data?
   A. Using CSS or XSLT
   B. Using FTP
   C. Using SMTP
   D. It cannot be separated
   Answer: A. CSS and XSLT style or transform XML for display. (Key point: Separating display)
