title: Create HTML webpage programmatically in C#
body: <p>I was wondering:  is there a way to create HTML files programmatically in C# as you can do with XML? Mine is a console application, so maybe some of the options are not available. Basically, I would like to do something smarter than just building a big string.</p>
  
  <p>Possible scenario:</p>
  
  <p>Instead of writing:</p>
  
  <pre><code>     string html="&lt;html&gt;&lt;head&gt;Blah&lt;/head&gt;&lt;body&gt;{0}&lt;/html&gt;", myotherstring
  </code></pre>
  
  <p>I would like to work as in XML</p>
  
  <pre><code>     XmlTextWriter w = new XmlTextWriter(xml_file_path + xml_file_name,
                                          System.Text.Encoding.UTF8);
  
       w.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
  
       // construct xml
       XmlElement root = xmlDoc.CreateElement("element");
  
       ...
  
       xmlDoc.Save(w);
       w.Close();
  </code></pre>
  
  <p>Apologies for the naive question.</p>