title: TSQL Removing tab and line feed from xml values
body: <p>I'm trying to select a value from a xml column field with the following query:</p>
  
  <pre><code>SELECT LTRIM(LocalData.value('(/root/questionphrase[@ln="nl"]/xhtml/p)[1]', 'nvarchar(max)'))
  FROM Question
  </code></pre>
  
  <p>The structure of my xml:</p>
  
  <pre><code>&lt;root&gt;
    &lt;questionphrase ln="nl"&gt;
      &lt;xhtml&gt;
        &lt;p&gt;
           Data I want to select&lt;/p&gt;
      &lt;/xhtml&gt;
    &lt;/questionphrase&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I'm getting back the expected values but they all start with 2 whitespaces. After some investigating it turns out there's a tab <code>char(9)</code> and a line feed character <code>char(10)</code> at the beginning of the string. Is there a generic way to strip these characters from the output without manually replacing them? I was hoping LTRIM and RTRIM would do the trick, but no luck so far.</p>
  
  <p><strong>Note:</strong> I only want to replace the characters in the beginning and the end of the string</p>