XML DOM | Introduction

XML DOM Introduction


Hello dear readers! we welcome you to our new tutorial series on DOM. In this tutorial, we will to be making a brief introduction to XML DOM.

What is XML DOM?

The Document Object Model (DOM) is a W3C standard. It defines a standard for accessing documents like HTML and XML.

The definition of DOM as put together by W3C is -

The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.


The Document Object Model (DOM) defines the objects and properties and methods (interface) to access all XML elements. It is separated into three different parts and levels -

  • Core DOM - standard model for any structured document
  • XML DOM - standard model for XML documents.
  • HTML DOM - standard model for HTML documents.
XML DOM is the standard object model for XML. XML documents have a hierarchy of informational units called nodes; DOM is a standard programming interface used to describe those nodes and the relationship between them.

An XML DOM also provides an API that lets a developer add, edit, move or remove nodes at any point on the tree in order to create a web application.

Following is the diagram for the DOM structure. The diagram represents that the parser evaluates an XML document as DOM structure by traversing through each node.

DOM structure

Advantages of XML DOM

Following below are the advantages of XML DOM -

  • XML DOM is modifiable - It is dynamic in nature, providing the developer a scope to add, edit, or remove nodes at any point in the tree.
  • XML DOM is language and platform independent.
  • XML DOM is traversable - Information in XML DOM is organized in hierarchy which allows developers to navigate around the hierarchy looking for specific information.

Disadvantages of XML DOM

  • It consumes more memory (If the XML structure is large) as program written once remains in memory all the time until and unless removed explicitly.
  • Due to the extensive usage of memory, its operational speed, compared to SAX is slow.


Alright guys! This is where we are going to be rounding up for this tutorial post. In our next tutorial, we are going to be discussing about XML DOM Model.

Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.