Fix missing XML preamble bug.
dispatch event only happens once.
0.2.29