The following are the advantages of DOM:
DOM stores the entire XML document into memory before processing. Therefore, the XML structure can be easily modified and values can be added, changed, and removed.
DOM enables to traverse the XML structure in any direction. It means that you can access any node of the XML structure by traversing through the XML structure.