make sure xml entities are injected correctly to the returned xml document. #339
minor.