Remove all warnings concerning XML
a little code refactoring