# AN ARTICLE EXPLAINING THE DIFFERENCES BETWEEN XML, XHTML and HTML
By Ologunowa Christiana
1. **XML or EXTENSIBLE MARKUP LANGUAGE**
XML also stands for Extensible Markup Language. XML is a markup language and file format used for data storage, transmission, and reconstruction, (GeeksforGeeks, 2024). XML lays out a series of guidelines for encoding documents in a format that is both machine-readable and human-readable. In other words, it “lets you define and store data in a shareable manner”. [(https://aws.amazon.com/what-is/xml/)](https://).
Information sharing between computer systems, including databases, websites, and third-party applications, is made possible through XML. Data can be transmitted as XML files across any network with ease thanks to predefined rules that the recipient can use to efficiently and accurately read the data. XML is not capable of computing tasks on its own, in contrast to other programming languages. Rather, structured data management can be implemented using any software or programming language. XML design focuses on usability, universality, and simplicity on the Internet.
**Benefits of Using XML**
Some benefits of using XML includes:
1. *Encourage business-to-business tran:* Businesses can use Extensible Markup Language (XML) to electronically exchange all the information they need and complete complicated transactions without the need for human involvement.
1. *Preserve data integrity:* By transferring data and its description, XML helps you avoid losing data integrity.
1. *Boost search efficiency:* XML files can be sorted and categorized more accurately and effectively than other document types by computer programs like search engines. As a result, XML facilitates more effective computer interpretation of natural language.
1. *Develop adjustable applications:* You may easily update or change your application's appearance with XML. Many technologies include built-in support for XML, particularly the more recent ones. You can make changes without having to rewrite your entire database because they can automatically read and process XML data files.
**XML file components**
An Extensible Markup Language (XML) file is a text-based document that you can save with the .xml extension. You can write XML similar to other text files. To create or edit an XML file, you can use any of the following: ***Text editors like Notepad or Notepad++; Online XML editors and Web browsers**.*
Any XML file includes the following components:
**XML document:** The `<xml></xml>` tags are used to mark the beginning and end of an XML file. An XML document is another name for the content included in these tags. Any software that wants to process XML code will start by looking for this tag.
**XML declaration:** An XML document starts with some XML-related information. It might, for instance, specify which version of XML it uses. We refer to this opening as an XML declaration. Below is an example:
`<?xml version="1.0" encoding="UTF-8"?>`
**XML elements:** according to W3schools (2025) “An XML element is everything from (including) the element's start tag to (including) the element's end tag”. XML elements are any additional tags you add to an XML document. These features can be found in XML elements:
* Text
* Attributes
* Other elements
* Mix of any of the above
It is worthy to note that all XML documents begin with a primary tag, which is called the “root element”.
A typical example of XML element is shown below:
```
<bookstore>
<book category="children">
<title>Harry Potter</title>
<author>J K.Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title>Learning XML</title>
<author>ErikT.Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
```
Source: [https://www.w3schools.com/xml/xml_elements.asp](https://)
In the example above:
`<title>, <author>, <year>, and <price> `
have text content because they contain text (like 29.99).
`<bookstore>` and `<book>` have element contents, because they contain elements.
`<book>` has an attribute (category="children").
**XML attributes:** Other descriptors, known as attributes, can be present in XML elements. As illustrated below, you can specify your own attribute names and write the attribute values inside quote marks "":
`<First Name=“John”>`
**XML content:** Another name for the data in XML files is XML content. For instance, the XML file may contain data such as is shown below:
```
<relative>
<name>John</name>
<name>Mark</name>
</relative>
```
From the code above, the data values *Charlie* and *Steve* are the content.
2. **XHTML OR EXTENSIBLE HYPERTEXT MARKUP LANGUAGE**
EXtensible HyperText Markup Language, or XHTML, is a hybrid of HTML and XML that is more stringent than HTML. It functions similarly to a manual for building browser-friendly web pages. You must be cautious and adhere to the requirements exactly, unlike HTML. It is supported by most browsers. Simply consider it as a more accurate method of writing web code.. "It is a stricter, more XML-based version of HTML. XHTML is HTML defined as an XML application and is supported by all major browsers" (W3schools.com).
XHTML was created to increase HTML's flexibility and extensibility so that it could be used with other data formats, including XML. Additionally, browsers strive to show the website even if there are some markup problems because they overlook HTML page errors. Therefore, XHTML has significantly more stringent error handling.
The World Wide Web Consortium (W3C) created the XHTML to assist web developers in switching from HTML to XML. With XHTML, developers can take advantage of all the benefits of XML while maintaining content compatibility in the future and in the past. The first of the three document formats in the XHTML family is XHTML 1.0, which was recommended by the W3C on January 26, 2000. The second is XHTML 1.1, which was proposed on May 31, 2001 by the W3C. The third standard is XHTML5, which is used to create an XML version of the HTML5 specification. An XHTML `<!DOCTYPE> `declaration is required for any XHTML document.
**Benefits of Using XHTML**
1. XHTML documents are well-structured, formatted, and transportable to Braille readers, wireless devices, and other specialized web environments.
2. Every XHTML tag needs to be properly nested and have closing tags. This generates code that is cleaner.
3. Because XHTML texts are lean, they consume less bandwidth. This lowers costs, especially if your website contains thousands of pages.
4. Collectively, XHTML and CSS enable the creation of easily updateable web pages.
Below is an example of an XHTML document as provided by [https://www.simplilearn.com/tutorials/html-tutorial/html-vs-xhtml](https://): 
Another example of a valid XHTML document as illustrated in [https://en.ryte.com/wiki/XHTML/](https://) is provided below:
```
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>An XHTML document</title>
</head>
<body>
<h1>Headline of the first order< /h1 >
<p>A paragraph with any text content</p>
<h2>Secondary heading</h2>
<p>Another paragraph with any text content</p>
</body>
</html>
```
3. **HTML or HYPERTEXT MARKUP LANGUAGE**
HTML, also known as Hypertext Markup Language, is a text-based method for specifying the structure of the data that is contained in an HTML file; it is used to create web pages. This markup instructs a web browser on how to present multimedia on a webpage, including text and images.
In order to format text, embed images, establish links, and construct interactive components, it uses tags and attributes to define the structure and content of web documents. HTML is an essential skill for web developers because it makes it easier for web browsers and servers to communicate.
Tim Berners-Lee, a physicist at CERN, created HTML in 1990. His goal was to develop an easy-to-use method for sharing and accessing documents online. HTML has seen substantial evolution since its inception and is now the bedrock of web development.
**Benefits of Using HTML**
1. HTML is simple to learn, use, and modify, because it is supported by all browsers.
1. It facilitates the creation of visually appealing web pages by supporting a large variety of colors, formats, and layouts.
1. The templates make the process of designing a website easier.
1. HTML is supported by FrontPage and several programming tools.
1. The most search-engine friendly format is HTML.
An example of HTML code is illustrated below:
```
<!DOCTYPE html>
<html>
<head>
<title>Web Page</title>
</head>
<body>
<h1>kristyidu</h1>
<p>HTML code for beginners</p>
</body>
</html>
```
**THE DIFFERENCES BETWEEN XML, XHTML AND HTML**
1. XML is like the parent of them all. XML is markup where you use `<opening>` and `</closing>` `<tags with="attributes">` to structure data.
Although XHTML is referred to as an "application" of XML, it is still XML with a list of tags that can be used and have distinct meanings, whereas XML allows you to use any tag (with `<b>`, `<div> `etc).
Although HTML is *almost* XHTML (it is based on Standard Generalized Markup Language, or "SGML"), HTML is a little more forgiving than XHTML, which requires very specific tag writing. (there's even tags without closing tags like `<br>`).
1. Another major differences among these three text languages is that XML was designed to store and transport data as well as to be both human- and machine-readable.
Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications. This can also be used for structuring and presenting content on the World Wide Web (especially HTML5). HTML5 is the fifth and current version of the HTML standard.
XHTML is HTML written as XML.
3. According to W3schools, the Most Important Differences between XTML and from HTML is illustrated below:
`<!DOCTYPE>` is mandatory
The xmlns attribute in `<html>` is mandatory
`<html>`, `<head>`, `<title>`, and `<body> `are mandatory
*Elements must always be properly nested
Elements must always be closed
Elements must always be in lowercase
Attribute names must always be in lowercase
Attribute values must always be quoted
Attribute minimization is forbidden*
1. The World Wide Web Consortium (W3C) developed XML as a simplified version of Standard Generalized Markup Language (SGML). XML was developed in the 1990s and published in 1998. While the HTML was proposed by Tim Berners-Lee in 1987, and the XHTML was proposed by the World Wide Web Consortium Recommendation in 2000.
2. The HTML was extended from Standard Generalized Markup Language (SGML). While the XHtML was extended from both the XML and HTML.
**REFERENCES**
AWS (2024): What is XML. https://aws.amazon.com/what-is/xml/
Ryte Wiki: XHTML
[https://en.ryte.com/wiki/XHTML/](https://)
Sololearn.com: What are difference between HTML, HTML5, XHTML and XML? [https://www.sololearn.com/en/Discuss/455600/what-are-difference-between-html-html5-xhtml-and-xml-](https://)
W3Schools (2025): XML Elements. https://www.w3schools.com/xml/xml_elements.asp