Toplevel parse routine, inner loop, separated root document creation.