You can do that in several ways, perhaps:(setq str "")
(foreach xref (xrefnamelist)
(setq str (strcat str "\n\r" xref))
)
(vla-put-comments si (strcat "\nXrefs: (vl-string-trim "\n\r" str)))
Edit, if you want to keep the new-line before the list, just omit that vl-string-trim function. It's unclear how you prefer it, since the code you've got would show the 1st xref on the 1st line, but your example shows it on the 2nd line.