added 'cleanMasterString' utility method and using it whenever parsing XMLs (closes #566)