title: HTML Agility Pack - Issue selecting an HTML select tag with the option tags within
body: <p>I am using HTML Agility Pack to select an element and return that element and everything it contains from an html string that is loaded.  In testing my code, I ran it against the select tag example from w3schools:</p>
  
  <pre><code>&lt;select name="cars"&gt;
    &lt;option value="volvo"&gt;Volvo XC90&lt;/option&gt;
    &lt;option value="saab"&gt;Saab 95&lt;/option&gt;
    &lt;option value="mercedes"&gt;Mercedes SLK&lt;/option&gt;
    &lt;option value="audi"&gt;Audi TT&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>When I try to select and return this with HTML agility pack, I get (option closing tags removed):</p>
  
  <pre><code>&lt;select name="cars"&gt;
    &lt;option value="volvo"&gt;Volvo XC90
    &lt;option value="saab"&gt;Saab 95
    &lt;option value="mercedes"&gt;Mercedes SLK
    &lt;option value="audi"&gt;Audi TT
  &lt;/select&gt;
  </code></pre>
  
  <p>So I did some searching here and found an instruction to add the line:
  HtmlNode.ElementsFlags.Remove("option");</p>
  
  <p>I did that, and now I get (the options text is moved outside of the option tags):</p>
  
  <pre><code>&lt;select name="cars"&gt;
    &lt;option value="volvo"&gt;&lt;/option&gt;Volvo XC90
    &lt;option value="saab"&gt;&lt;/option&gt;Saab 95
    &lt;option value="mercedes"&gt;&lt;/option&gt;Mercedes SLK
    &lt;option value="audi"&gt;&lt;/option&gt;Audi TT
  &lt;/select&gt;
  </code></pre>
  
  <p>I would like the output to match the original HTML.  What do I need to do to get that?</p>
  
  <p>I was also playing with the OptionWriteEmptyNodes as when I tested with input tags their self closing was being removed, adding that option seemed to fix that.  I commented it out now to make sure it wasn't impacting this issue.</p>
  
  <p>This is my .NET C# code:</p>
  
  <pre><code>HtmlDocument doc = new HtmlDocument();
  doc.LoadHtml(content);
  HtmlNode.ElementsFlags.Remove("option"); // otherwise, the closing tag is removed.
  
  //doc.OptionWriteEmptyNodes = true;
  
  var nodes = doc.DocumentNode.SelectNodes("//select");
  
  if (nodes == null)
      return "Not found";
  else
      return nodes[0].OuterHtml;
  </code></pre>