PHP / SOAP / XML:如何解析这个XML?

This is part of the XML SOAP response that I'm having trouble parsing:

<soap:Envelope><soap:Body><getTrainScheduleXMLResponse><getTrainScheduleXMLResult><STATION><STATION_2CHAR>NY</STATION_2CHAR><STATIONNAME>New York Penn Station</STATIONNAME><ITEMS><ITEM><ITEM_INDEX>0</ITEM_INDEX><SCHED_DEP_DATE>18:08:00 06/10/2013</SCHED_DEP_DATE><DESTINATION>MSU</DESTINATION><TRACK>6</TRACK><LINE>MNBTN</LINE><TRAIN_ID>6279</TRAIN_ID><STATUS>ALL ABOARD</STATUS><BACKCOLOR>brown</BACKCOLOR><FORECOLOR>white</FORECOLOR><SHADOWCOLOR>black</SHADOWCOLOR><GPSLATITUDE/><GPSLONGITUDE/><GPSTIME>6/10/2013 5:45:30 PM</GPSTIME><TRAIN_LINE>Montclair-Boonton Line</TRAIN_LINE><STATION_POSITION>0</STATION_POSITION><LINEABBREVIATION>MNBTN</LINEABBREVIATION><INLINEMSG/><STOPS><STOP><NAME>Newark Broad Street</NAME><TIME>6/10/2013 6:25:00 PM</TIME></STOP><STOP><NAME>Watsessing Avenue</NAME><TIME>6/10/2013 6:31:30 PM</TIME></STOP><STOP><NAME>Bloomfield</NAME><TIME>6/10/2013 6:34:00 PM</TIME></STOP><STOP><NAME>Glen Ridge</NAME><TIME>6/10/2013 6:36:30 PM</TIME></STOP><STOP><NAME>Bay Street</NAME><TIME>6/10/2013 6:39:30 PM</TIME></STOP><STOP><NAME>Walnut Street</NAME><TIME>6/10/2013 6:43:00 PM</TIME></STOP><STOP><NAME>Watchung Avenue</NAME><TIME>6/10/2013 6:45:30 PM</TIME></STOP><STOP><NAME>Upper Montclair</NAME><TIME>6/10/2013 6:48:30 PM</TIME></STOP><STOP><NAME>Mountain Avenue</NAME><TIME>6/10/2013 6:51:00 PM</TIME></STOP><STOP><NAME>Montclair Heights</NAME><TIME>6/10/2013 6:53:30 PM</TIME></STOP><STOP><NAME>Montclair State U</NAME><TIME>6/10/2013 6:59:00 PM</TIME></STOP></STOPS></ITEM>

I have tried doing this:

$xmlstr = file_get_contents("data.xml");
$xml = new SimpleXMLElement($xmlstr);
var_dump($xml);

But it returns output of this:

object(SimpleXMLElement)#1 (0) {
}

Which I take to mean it's empty? How can I parse this XML in PHP? This isn't a complete file provided. Thanks!

This is very much so a hack, because ideal you should consume Soap requests with the SoapClient class, but if you were to strip out the soap namespace, you should be able to feed your request through simpleXML

$xml = new SimpleXMLElement(str_replace('<soap:','<',$xmlstr));

To consume a soap service if you've been given a WSDL might be as simple as...

$client = new SoapClient('http://www.domain.com/service/soap.wsdl');
$result = $client->someMethodCall($params,$params);