I still don't understand quite what it is you want to get. An example of the expected output would definitely help.
Some comments though, maybe they will put you on the right track:
- if you don't want to print the document, then don't use flush, because that's what it does. Now if what you want is to free memory, then purge is probably what you are looking for,
- you have 2 handler: on on docsum and one on para. Sadly there are no docsum (there is a DocSum but XML is case-sensitive), nor para elements in the document, so these handlers are never called.