1. Basic concepts

DOM, the full name of domcument Object Model, is a tree structure. It is called a tree structure because each layer of DOM is like a part of the tree, with main poles, branches and details, spreading down layer by layer.

The DOM defines a common way to access and manipulate XML documents. The DOM views XML documents as a tree structure through which all elements can be read and written.

2, Dom4j

Dom4j is an easy-to-use, open source library for parsing XML. It is applied to the Java platform, with excellent performance, powerful and easy to use characteristics.

Dom4j treats XML as a Document object. XML tags are defined by Dom4j as Element objects.

You can import Dom4j and then read the XML file.