Improve xml handling

Fixed #1666. Previous parser does not work for multi line statements with `//` 
I believe it's @eed3si9n who opened a ticket about an ability to revert to old parsing logic and planned to work on a fix.