title: Get element by xpath on HTML string
body: <p>I have a JS variable that contains an a string that represents an HTML page. For example:</p>
  <pre><code>var response = &quot;&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;h1&gt;This is heading 1&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;&quot;
  </code></pre>
  <p>I'd like to perform query selectors and xpath evaluations on this response to traverse through the HTML elements. Since the response is not in the DOM I can't use <code>document.x</code> actions.</p>
  <p>One option is to write it into an invisible iframe in the DOM but this is not allowed for Chrome extensions. Are there any other alternatives?</p>