Better handling of xmlinput.start/end