Fixed XMLParser bug

Parser now respects from/to tags instead of assuming that each term
appears once. Also small changes to subtask 2.