fixing domDocument encoding problems.