public void asXML(final Writer w,final String encoding,final Pattern filter) throws IOException {
  w.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\" ?>");
  asXML(w,filter);
}

public void asXML ( final Writer w , final String encoding , final Pattern filter ) throws IOException { w . write ( "<?xml version=\"1.0\" encoding=\"" + encoding + "\" ?>" ) ; asXML ( w , filter ) ; }
alternative , but you are still required to specify the character set encoding in use by the writer .
