Read entire XML file and store in memory java
===

Here is what I am trying to do.

 1. Read entire XML file (I do not care the name of element or attribute,etc..).
 2. Save the read XML file into memory.
 3. Update some values of read xml file.
 4. Write back to a XML file.

I am trying to use XMLStreamReader to read a XML file, however all the examples I see so far, it looks like i have to provide element name.  But, I do not care about element names, just want to read entier XML file into memory.  And, I am not sure how datatype I should be storing as I am reading.  I am thinking to store them into Document datatype.

Any suggestions on how to read entire XML file and store read contents in memeory?

Thanks.