Replace XML serializer in plaintext export

Fixes #342
Alternative to #929