First working draft

- got tests working
- I guess the node order for the XML is SUPER important
- some bug fixes