I have SOAP XML response like below, please suggest me how can I find the data like room code, hotel code, currency etc. from this. I also used below code but its not working means it returns empty.
$xmlObject = simplexml_load_string($xmlString);
$array = json_decode(json_encode($xmlObject), true);
The corresponding XML response :
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ResponseId xmlns="http://www.example.com/">e96c9439-6049-4abb-b070-f7f0024153b7@52-20-187-176</ResponseId>
</soap:Header>
<soap:Body>
<ns4:FetchRoomAllotmentResponse xmlns:ns4="http://www.example.com/" xmlns:ns2="http://www.example.com" xmlns:ns3="http://www.example.com/">
<ns4:FetchRoomAllotmentResult>
<ns4:Response>
<ns4:Hotel Code="201511191642109768" Name="TestCMHotel" />
<ns4:Rooms>
<ns4:Room Code="171578" Name="2 Bed Super Deluxe">
<ns4:Rates>
<ns4:Rate Currency="INR" Description="2 Bed Super Deluxe" Id="71624608833328" MealPlan="MAP" ValidFrom="2015-11-19" ValidTo="2017-04-30">
<ns4:Inclusions>
<ns4:Inclusion code="test inclusion test inclusion test inclusion test inclusion test inclusion">test inclusion test inclusion test inclusion test inclusion test inclusion</ns4:Inclusion>
</ns4:Inclusions>
</ns4:Rate>
</ns4:Rates>
</ns4:Room>
<ns4:Room Code="19505" Name="AC Deluxe Room AC">
<ns4:Rates>
<ns4:Rate Currency="INR" Description="AC Deluxe Room AC" Id="5835231260301" MealPlan="EP" ValidFrom="2015-11-19" ValidTo="2017-05-31">
<ns4:Inclusions>
<ns4:Inclusion code="test 1">test 1</ns4:Inclusion>
<ns4:Inclusion code="test inclusion test inclusion test inclusion test inclusion test inclusion">test inclusion test inclusion test inclusion test inclusion test inclusion</ns4:Inclusion>
</ns4:Inclusions>
</ns4:Rate>
</ns4:Rates>
</ns4:Room>
<ns4:Room Code="18303" Name="Standar AC">
<ns4:Rates>
<ns4:Rate Currency="INR" Description="Standar AC" Id="79045408874412" MealPlan="CP" ValidFrom="2015-11-19" ValidTo="2017-06-30">
<ns4:Inclusions>
<ns4:Inclusion code="test wifi and swiimming pool on a stay og one night or multiple nights 1 night or multiple nights te">test wifi and swiimming pool on a stay og one night or multiple nights 1 night or multiple nights te</ns4:Inclusion>
</ns4:Inclusions>
</ns4:Rate>
</ns4:Rates>
</ns4:Room>
</ns4:Rooms>
</ns4:Response>
</ns4:FetchRoomAllotmentResult>
</ns4:FetchRoomAllotmentResponse>
</soap:Body>
</soap:Envelope>