I've find out the problem! PrettyPrinter crushes ONLY if there is `encoding="windows-1251"` - no matter which encoding is really used, which alphabet is used and which part of document is selected! :smiley: I think it's still a bug and it should be fixed :relieved: Just ingore `encoding=` in `<?xml ... ?>` and everybody will be happy! :sunglasses: