public MarkupWriter newMarkupWriter(ContentType contentType)
{
boolean isHTML = contentType.getMimeType().equalsIgnoreCase("text/html");
MarkupModel model = isHTML ? _htmlModel : _xmlModel;
// The charset parameter sets the encoding attribute of the XML declaration, if
// not null and if using the XML model.
return new MarkupWriterImpl(model, contentType.getParameter("charset"));