IDEA-103417 Incorrect Statement completion in XML

#IDEA-103417 fixed
Formatting
IDEA-99207 (try to show GUI error notifications if started not from console)