To complete @jens-erat 's answer, with XQuery 1.0 (without string-join),
data() will concatenate your sequences,
a bit of replace will allow you to control (remove) whatever separator it decided to use,
and a substring will remove your tuned separator from before the first item:
substring(replace(data(<ul>{for $v in distinct-values(//li) return concat(", ",$v)}</ul>)," ,",","),3)
(that's for those who like me are stuck 10 years ago with an Oracle 11.2's XMLTable to operate)