Improve xml handling

Fixed #1666. Previous parser does not work for multi line statements with `//`