PeterVandivier
Consider the following...
<>https://dbfiddle.uk/NbgYdq52?hide=2
...currently rendering as...

I crafted this fiddle to support https://dba.stackexchange.com/a/329214/68127, which includes a screencap of an XML result in the post body.
The fiddle results as-is would be more instructive to this use case if they were pretty-printed as in SSMS.
Top Answer
Jack Douglas
Thanks, this is a good suggestion and it's now implemented.
Your query result is of type `NVARCHAR(MAX)` so you need to [use the `TYPE` directive](https://learn.microsoft.com/en-us/sql/relational-databases/xml/type-directive-in-for-xml-queries?view=sql-server-ver16):
> SQL Server support for the xml (Transact-SQL) data type enables you to optionally request that the result of a FOR XML query be returned as xml by specifying the TYPE directive.
This makes the pretty-printing kick in: https://dbfiddle.uk/G4ZyrGCo?hide=2
