I'm not sure there's any way to handle text files that large in PHP that will qualify as "efficient". Reading the whole file into memory via file() or file_get_contents() is likely going to cause memory usage problems, and reading a line at a time is probably going to be too slow.
For that matter, I'm not sure that any language is going to efficiently read and parse a 5 GB XML file (at least not without a high-quality, dedicated server to do the work). It might be time to give the whole concept a careful look and determine if this whole concept makes sense or if there's a simpler way to get the data you need. (For instance, how much duplicate and/or unwanted data is included in each XML file?)