Just the same - the xml functions don't parse files, they parse strings.
The only place where XML functions and file function meet in the example script is
xml_parse($xml_parser, $data, feof($fp))
$xml_parser is just the parser itself.
$data is just a string of text (yeah, sure, it just came out of a file, but it could've come from anywhere)
feof($fp) is the bit that may be worrying you. When you're reading from a file, you probably won't be reading all of the XML in at once, so you need to tell the parser that there is still more to come. This third argument is called "isFinal" and is either true (this is the last bit of XML) or false (there's more XML to come after thsi)
Since you have all of your XML in a single string already, you won't be sending it any more afterwards. So you would write true for the third argument, i.e.
xml_parse($xml_parser, $data, true)
Ps. don't forget to xml_create() the parser before use 🙂