in reply to Replacing Lines in 100 Gig file

Is '<root>' a valid element in the rest of the file? If not, then just remove all '<?xml' and '<root>' and '</root>' lines. And write the initial and final ones manually.