You could, but that's not the recommended way. You'll likely have problems with character set encoding (most XML docs are UTF-8, Java uses UTF-16 internally), plus you'd have to write functions to escape the special characters (entities) when that functionality is already in the DOM, waiting for you to use it.
So, yes you could, but if you have to exchange your XML doc with someone else, they might have problems reading it.
Chip H.