One approach is to write a wrapper class for the XmlWriter. So:
XmlWriter writer = new MyXmlWriterWrapper(XmlWriter.Create(..., settings))
Then for the MyXmlWriterWrapper class define each method on the XmlWriter class interface to pass the call straight through to the wrapped writer, except for the WriteDocType method. You can then define that as something like:
public override void WriteDocType(string name, string pubid, string sysid, string subset)
{
if ((pubid == null) && (sysid == null) && (subset == null))
{
this.wrappedWriter.WriteRaw("<!DOCTYPE HTML>");
}
else
{
this.wrappedWriter.WriteDocType(name, pubid, sysid, subset);
}
}
Not an especially clean solution admittedly, but it'll do the job.