For record type of
type ARecordType = { Aaa: string; Bbb: string; Id: int; Ccc: string }
How to convert it to an Xml string?
let recordTypeToXml (recordType: seq<ARecordType>) =
.....
returns
<Root><Row><Aaa>...</Aaa>...</Row>.....</Root>
or
<Root><Row @Aaa="..." @Bbb="..." ... />....</Root>
Or can it be a generic function that can handle any record type?
This is straightforward using Linq to Xml:
You can shorten this a bit by wrapping some of the method calls with operators or functions. For example, with these two helper functions:
it's much cleaner: