I have used the the IBM XML parser and the code to set
the encoding type is this
((TXDocument)gvObjDoc).setEncoding("US-ASCII");
gvObjDoc = Object of type Document
When I use the Xerces Parser I use the following
OutputFormat format = new OutputFormat( doc ,
"UTF-8", true); //Serialize DOM
StringWriter stringOut = new StringWriter();//Writer
will be a String
XMLSerializer serial = new XMLSerializer( stringOut,
format );
What parser are you using ??