SAX Parsing is better for implementation than DOM, see the difference between the two in the following:
Dom
The nodes are in the form of a memory tree structure: it takes up more memory, the DOM is used only for small XML documents. Slower at run time. Saved as an object. Software easy to implement Ease of navigation and use.
Sax
Sequence of events He does not use the memory preferred for large documents. Faster at runtime, due to the above item. Objects must be created. You must write code to create objects In SAX, reverse navigation is not possible, because it sequentially processes the document
So, if you have very large files, you should use a SAX parser, since it will trigger events and release them, nothing is stored in memory, and with the help of the SAX analyzer you cannot access the element randomly,!, But Dom allows you to access any part of the xml file as it saves the entire file / document in memory.
see the article and you can get what you want by reading the Summary .
also check this link to view the performance of various xml parser

K_Anas
source share