If you change the return type of an XQuery function to xs:string, your nodes will be implicitly converted to strings.
This is the standard behavior of XQuery and no particular feature of RESTXQ. Play around with the query that I presented in my previous answer.
You need to remove the xs:string* return typeb you can replace it with item()*.