I have an XML document, and I want to print the tag names and values (of leaf nodes) of all tags in the document.
For example, for the XML:
<library>
<bookrack>
<book>
<name>Book1</name>
<price>$10</price>
</book>
<book>
<name>Book2</name>
<price>$15</price>
</book>
</bookrack>
</library>
The output should be something like:
library=
bookrack=
book=
name=Book1
price=$10
book=
name=Book2
price=$15
Help please!