Could anyone give me any suggestion on how to implement an XML cache?
What do you mean by "XML cache"?
How about trying to define an "XML cache"?
What comes to mind is nothing different from a "typical" cache: you've got an abstract chunk of data (java.lang.Object?) and a key (long, String, something very simple), which identifies the cached data unambiguously.
If you're not talking about something else, the question is about the key -- how is the key constructed for a given XML document?