I searched for a while on this topic and found some results too, which I am mentioning at the end of post. Can someone help me precisely answer these three questions for the cases listed below them?
For which use-cases using XmlSluper makes more sense than XmlParser and vice-versa (from point of view ease of use of API/Syntax)?
Which one is more memory efficient? (looks like Slurper)
which one processes the xml faster?
Case a. when I have to read almost all nodes in the xml?
Case b. when I have to read just few nodes (like using gpath expression)?
Case c. when I have to update/transform the xml?
provided the xml document is not trivial one (with level of depths and size of the xml).
Resources :
http://www.tutkiun.com/2009/10/xmlparser-and-xmlslurper.html states :
Difference between XMLParser and XMLSlurper:
There are similarities between XMLParser and XMLSlurper when used for simple reading but when we use them for advanced reading and when processing XML documents in other formats there are differences between two.
XMLParser stores intermediate results after parsing documents. But on the other hand,
XMLSlurper does not stores internal results after processing XML documents.
The real, fundamental differences become apparent when processing the parsed information. That is when processing with direct in-place data manipulation and processing in a streaming scenario.
http://groovy.dzone.com/news/john-wilson-groovy-and-xml
The groovy doc (XmlParser, XmlSlurper) and the groovy's site explains them well (here and here)but does not do a great job in explaining the aforementioned question.