title: How do I use HTML Agility Pack to edit an HTML snippet
body: <p>So I have an HTML snippet that I want to modify using C#.</p>
  
  <pre><code>&lt;div&gt;
  This is a specialSearchWord that I want to link to
  &lt;img src="anImage.jpg" /&gt;
  &lt;a href="foo.htm"&gt;A hyperlink&lt;/a&gt;
  Some more text and that specialSearchWord again.
  &lt;/div&gt;
  </code></pre>
  
  <p>and I want to transform it to this:</p>
  
  <pre><code>&lt;div&gt;
  This is a &lt;a class="special" href="http://mysite.com/search/specialSearchWord"&gt;specialSearchWord&lt;/a&gt; that I want to link to
  &lt;img src="anImage.jpg" /&gt;
  &lt;a href="foo.htm"&gt;A hyperlink&lt;/a&gt;
  Some more text and that &lt;a class="special" href="http://mysite.com/search/specialSearchWord"&gt;specialSearchWord&lt;/a&gt; again.
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm going to use HTML Agility Pack based on the many recommendations here, but I don't know where I'm going. In particular,</p>
  
  <ol>
  <li>How do I load a partial snippet as a string, instead of a full HTML document?</li>
  <li>How do edit?</li>
  <li>How do I then return the text string of the edited object?</li>
  </ol>