[xml mode] correct empty attributes handling

This patch seem to fix issue #902.