serialize with prettyxml