if ( model.getModelEncoding() == null )
model.setModelEncoding( "UTF-8" );
OutputStreamWriter w = new OutputStreamWriter( projectStream, model.getModelEncoding() );
try
{
MavenStaxWriter writer = new MavenStaxWriter();
writer.write( w, model );
}
finally
{
w.close();
}