Added function to convert nodelist to array.