Need to read XML document and get the values of element tag and their values. but until run-time the values of the XML element nodes are unknown. so can't use XPATH to extract values. Any suggestions to handle this problem
assume this is the xml that i have. all the elements names are unknown. Don't know how many is there. what i want to get element name, element level, value. this xml contain template for another xml document.
<d2>
<d3>
<d4>
<d5>
<d6>@name@</d6>
<d6>@name@</d6>
</d5>
<d5>
<d6>@name@</d6>
<d6>@name@</d6>
</d5>
<d5>@name@</d5>
<d5>@name@</d5>
</d4>
</d3>
<d3>@name@</d3>
<d3>
<d4>@name@</d4>
<d4>
<d5>@age@</d5>
<d5>
<d6>@name@</d6>
<d6>@date@</d6>
</d5>
</d4>
</d3>
</d2>