removing whitespaces from xml strings before passing to the constructor