Better XML handling, output now has all triggers