How to read an XML file with Java?
- by Yatendra Goel
I don't need to read complex XML files. I just want to read the following configuration file with a simplest XML reader
<config>
    <db-host>localhost</db-host>
    <db-port>3306</db-port>
    <db-username>root</db-username>
    <db-password>root</db-password>
    <db-name>cash</db-name>
</config>
How to read the above XML file with a XML reader through Java?