trim xmlstring before parsing