IDEA-107118 Generate XML tag hangs
(cherry picked from commit 96ce479)