title: How to use Heredocs with XPath
body: <p>I struggle with the following problem:</p>
  
  <p>Have an XPath like so (as you can see quite long):</p>
  
  <pre><code>'//h2[contains(text(),"Kontakt")]/../following-sibling::div[contains(@class,"body") and child::dl[contains(@class,"horizontal")]]'
  </code></pre>
  
  <p>Now, to make it more readable i tried to split it into multiple lines using Heredoc:</p>
  
  <pre><code>xpath = &lt;&lt;-XPath.gsub(/\s+/,'')
    //h2[contains(text(),"Kontakt")]/..
    /following-sibling::div[contains(@class,"body") and
    child::dl[contains(@class,"horizontal")]]
  XPath
  </code></pre>
  
  <p>The catch, however, is that the <code>.gsub(/\s+/,'')</code> will remove all whitespaces. I have tried different combinations with just removing <code>\n</code> or <code>.strip</code>, but I can't seem to find a solution that outputs the xpath as it is shown above.</p>
  
  <p>Any thougts?</p>