Reimplement applications xml parsing
Add test for applications