implemented dump to xml (fixes #2)