Xml parsing

This pull request shows a way the current text based parsing could be replaced with xml based parsing. 

It only works with the command-line tool, but this pull request is only meant to show the concept. 

Is this a way the project should go? 
If yes: then I don't mind creating a pull request that can be merged safely into trunk.