Custom XML Parser

As an exercise I am trying to create an XML parser using the built-in flow services and some custom Java services. I want to create a generic XML parser that can go through multiple levels of nested tags and map them into a hash table, creating a flat structure. To achieve this I have created an recursive flow service that takes the XML file as a document(pub: xml: xmlNodeToDocument) and moves through the tags using a custom Java service and an IData Cursor. As I am stuck with my solution I wanted to get some fresh ideas. So if you wanted to create a generic XML parser to get the tags into a flat structure (like a hash table) how would you do it?

Example Input:

John Jill 2020

Example Output:
Body/Record/Employee: John
Body/Record/Student: Jill
Body/Date: 2020