Let's say I have the following class:
class Person (val firstName: String, val lastName: String)
Is there an automatic way to generate xml from this class without having to create a toXml () method? Ideally, the output would be something like this:
<Person>
<firstName> John </firstName>
<lastName> Smith </lastName>
</Person>
There seems to be a way to do this without writing it all down manually. Perhaps there is a trait that I have not yet found?
source
share