title: Delete nodes with certain value from XML using TSQL
body: <p>I'm trying to parse a piece of XML and remove nodes that contain certain values. I know how to remove them if the value is exact, but I want to use something like a "contains".</p>
  
  <p>This works to delete exactly:</p>
  
  <pre><code>update @XML set data.modify('delete //Message[text() = "customer has deleted their account"]')
  </code></pre>
  
  <p>But I want to delete where the "Message" node just contains the text, something like:</p>
  
  <pre><code>update @XML set data.modify('delete //Message[contains(text(), "customer")]')
  </code></pre>
  
  <p>However this returns the error:</p>
  
  <pre><code>XQuery [@XML.data.modify()]: 'contains()' requires a singleton (or empty sequence), found operand of type 'xdt:untypedAtomic *'
  </code></pre>