Newline at the end - does not matter, Scribus can read files with and without newlines at the end
<TableBorderLine Width="1" PenStyle="1" Color="Black" Shade="100"/> gets rewritten to <TableBorderLine Width="1" PenStyle="1" Color="Black" Shade="100"></TableBorderLine> - not nice since it increases the file size, but Scribus can read the file nevertheless
Randomly inserted LF
 and spaces - this is the real problem. Why is this happening, what am I doing wrong?
Manually replacing the 
 with nothing does fix the file. But it’s a crude workaround.
According to https://stackoverflow.com/a/32399389 I am supposed to add ,innerxml to the struct definition but for the heck of it I can’t seem to get it to work.
For example, I have
type SCRIBUSUTF8NEW struct {
XMLName xml.Name `xml:"SCRIBUSUTF8NEW"`
(...)