Group search - in fact is a selection of common elements from different results and assigning connections on which it is possible to collect flights between them. Analogical to the normalization procedure in relational databases.
Within the grouping of flights, the following structural elements were singled out:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Search_1_2Response xmlns="http://nemo-ibe.com/Avia">
<Search_1_2Result xmlns:a="http://nemo-ibe.com/STL" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:RequestID>256568515</a:RequestID>
<a:ResponseBody>
<SearchData />
<SimpleGroupedFlights>
<AirItineraries>
<AirItinerary/>
<AirItinerary/>
<AirItinerary/>
</AirItineraries>
<Prices>
<GroupedPrice/>
<GroupedPrice/>
<GroupedPrice/>
</Prices>
<FlightSegments>
<FlightSegment/>
<FlightSegment/>
<FlightSegment/>
</FlightSegments>
<FlightPriceGroups>
<FlightPriceGroup/>
<FlightPriceGroup/>
<FlightPriceGroup/>
</FlightPriceGroups>
</SimpleGroupedFlights>
<FareFamiliesDescription/>
<SubsidiesInformation/>
</a:ResponseBody>
</Search_1_2Result>
</Search_1_2Response>
</s:Body>
</s:Envelope>
For successful parsing of the response it is required to compare the elements in different groups by their identifiers (ID)
To optimize your group search handler, it is recommended to carry out the go-round of elements in 2 steps. At first you bypass all the elements of each group and index them by the specified value in the ID field. And that, once you bypass flights FlightPriceGroup and fill them with data on segments and prices by selecting data from the index. For indexing, you can use the hash tables of your programming language.