The following are two main types of XML parsers:
Tree-based API - Compiles an XML document into a tree structure and loads it into memory. You can traverse and change the tree structure. The DOM is an example of a tree-based API.
Event-based API - Provides the report to an application about the parsing events by a set of built-in callback functions. An example of the event-based API is SAX.