Fixed subtle flatten XML bug when empty nodes