posted 12 years ago
What are you doing wrong? You're assuming that the toString() method of a Node object produces some useful information. Perhaps you were even imagining that it would return a representation of the Node object, or something like that.
But it doesn't. In many Document implementations you will find that toString() returns the same thing as getNodeValue(), and you can see in the API documentation for the org.w3c.dom.Node interface what that is. (It's usually null.)