# How to generate Code cell including newlines

I want to programmatically create a "Code" style cell with commands separated by ; and a new line (from some list). Say for example I have a list {set[a,1],set[b,2],...} I would like to create the cell.

a=1;
b=2;
...


This can almost be done by following the answer to a similar question here, and replacing "Input" with "Code". I find that CompoundExpression@@{a,b,...} does show as a;b;..., as I would like, but I don't know how to add the appropriate newlines.

format[l_List] :=