title: Concatenate specific attribute of all elements together with xquery
body: <p>How can I concatenate a specific attribute of all elements together using SQL XQuery?</p>
  
  <p>I have a table like this:</p>
  
  <pre><code>InvoiceId   Details
  ---------   -----------------------------------------------------------------
  1001        &lt;Stuff Id="101" p="3" q="5"/&gt;&lt;Stuff Id="102" q="4"/&gt;&lt;Stuff Id="103"/&gt;
  1002        &lt;Stuff Id="201" /&gt;&lt;Stuff Id="202" q="2"/&gt;
  </code></pre>
  
  <p>and need this result => </p>
  
  <pre><code>InvoiceId  IdDetails
  ---------   ---------------------
  1001        101,102,103
  1002        201,202
  </code></pre>