Better xmleditor event listener handling