How to avoid duplication in my document writer?
You need to look at what's common to both methods:

StringBuilder builder = new StringBuilder();
using (StringWriter stringWriter = new StringWriter(builder))
{
    using (XmlWriter writer = XmlWriter.Create(stringWriter))
    {
        writer.WriteStartDocument();
        writer.WriteStartElement(/* different in the two methods */);
        WriteTypeHeader(writer, header);
        foreach (TypeDetail typ in TypeDetailList)
        {
            /* different in the two methods */
        }
        writer.WriteEndElement();
        writer.WriteEndDocument();
    }
}


Looks like you could have a base class with a GenerateXml method calling into abstract members that derived types (Type1XmlGenerator, Type2XmlGenerator... whatever Type1 and Type2 means) can override:

public abstract class XmlGenerator
{
    protected abstract void WriteDetails(XmlWriter writer, TypeDetail type);
    protected abstract string XmlRootNode { get; }

    public string GenerateXml(TypeHeader header, IEnumerable&lt;TypeDetail&gt; details)
    {
        StringBuilder builder = new StringBuilder();
        using (StringWriter stringWriter = new StringWriter(builder))
        {
            using (XmlWriter writer = XmlWriter.Create(stringWriter))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement(XmlRootNode);
                WriteTypeHeader(writer, header);
                foreach (TypeDetail detail in details)
                {
                    WriteDetails(writer, detail);
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }
    }
}


Then you can have a class Type1XmlGenerator : XmlGenerator that will override the WriteDetails method with what you currently have in WriteType1Detail, and the XmlRootNode property getter implementation will return xmlElementConfig.CreateType1RootNode.



Now, writing/generating XML is a solved problem, doing that with a StringBuilder is error-prone. You should really look into what LINQ-to-XML (System.Xml.Linq) has in store for you.