Fix NPE issues in xml file parsing

Now with the correct indentation. Sorry about that.