Q:

Parsing the XML in C#

I am getting the flight details from the expedia API, please check the link below for the XML format.
The result output contains Rateinfo then flight details as separate node and there is no relation between rateinfo and flightsegment. 
Normally I load the XML into dataset and use the dataset to populate the records, but in this case there is no relation between rate and flight segment, how will I parse this XML in C#. I need to show the user the flight segments and the corresponding rates.
http://api.ean.com/ean-services/rs/air/200919/xmlinterface.jsp?cid=55505&resType=air&intfc=ws&apiKey=fc9hjrvrur9vr4y2dqa249w4&xml=<AirSessionRequest method="getAirAvailability"><AirAvailabilityQuery><originCityCode>MCI</originCityCode><destinationCityCode>CLT</destinationCityCode><departureDateTime>09/01/2011 01:00 AM</departureDateTime><returnDateTime>09/04/2011 01:00 AM</returnDateTime><fareClass>Y</fareClass><tripType>R</tripType><Passengers><adultPassengers>2</adultPassengers></Passengers><xmlResultFormat>1</xmlResultFormat><searchType>2</searchType></AirAvailabilityQuery></AirSessionRequest>

A:

A dataset represents relational data much easier than hierarchial data, which is what the xml represents, and that is probably the crux of your problem.
Linq2Xml is one option, or you could create a set of classes that are seriealizable and deserialize the xml into instances of the class, so then you can just iterate through the classes with foreach, or use linq on them.
I'm not saying this is the best way to go about doing what you need, but it is relatively tidy, and you don't need to deal with xml, just class instances.  I tested this with the xml you provided and it worked quite well, although I do think that the Linq2Xml method might be more performant - Not 100% sure though.
Assuming your xml is in a variable called sXmlResult:
public class Test
{
    public void Run()
    {
        //Load the xml and serialize it into instances of our classes
        System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(AirAvailabilityResults));

        System.IO.StringReader sr = new System.IO.StringReader(sXmlResult);
        AirAvailabilityResults results = (AirAvailabilityResults)ser.Deserialize(sr);

        //Now we can access all the data like we would any other object.
        foreach (AirAvailabilityReply reply in results.AirAvailabilityReply)
        {
            double dNativeBaseFare = reply.RateInfo.nativeBaseFare;

            foreach (FlightSegment segment in reply.FlightSegment)
            {
                int iFlightNumber = segment.flightNumber;
            }
        }
    }
}

//Create the seriealizable classes to represent the xml.  
//I created these by infering the schema from the xml.  These classes may need some changes, if 
//they don't exactly match the actual schema that expedia uses
public class AirAvailabilityResults
{
    [System.Xml.Serialization.XmlElement()]
    public AirAvailabilityReply[] AirAvailabilityReply { get; set; }

    [System.Xml.Serialization.XmlAttribute()]
    public int size {get;set;}

    [System.Xml.Serialization.XmlElement()]
    public string cacheKey {get;set;}

    [System.Xml.Serialization.XmlElement()]
    public string cacheLocation {get;set;}

}

public class AirAvailabilityReply
{
    public enum SupplierType
    {
        S
    }
    public enum TripType
    {
        R
    }
    public enum TicketType
    {
        E
    }

    [System.Xml.Serialization.XmlElement()]
    public SupplierType supplierType {get;set;}

    [System.Xml.Serialization.XmlElement()]
    public TripType tripType {get;set;}

    [System.Xml.Serialization.XmlElement()]
    public TicketType ticketType {get;set;}

    public RateInfo RateInfo { get; set; }

    [System.Xml.Serialization.XmlElement()]
    public FlightSegment[] FlightSegment {get;set;}
}

public class RateInfo
{
    public double nativeBaseFare {get;set;}
    public double nativeTotalPrice {get;set;}
    public string nativeCurrencyCode { get; set; }
    public double displayBaseFare {get;set;}
    public double displayTotalPrice {get;set;}
    public string displayCurrencyCode { get; set; }
}

public class FlightSegment
{
    public bool segmentOutgoing {get;set;}
    public string airlineCode {get;set;}
    public string airline {get;set;}
    public int flightNumber {get;set;}
    public string originCityCode {get;set;}
    public string destinationCityCode {get;set;}
    public string departureDateTime {get;set;}
    public string arrivalDateTime { get; set; }
    public string fareClass {get;set;}
    public string equipmentCode {get;set;}
    public int numberOfStops {get;set;}
    public string originCity {get;set;}
    public string originStateProvince {get;set;}
    public string originCountry {get;set;}
    public string destinationCity {get;set;}
    public string desintationStateProvince {get;set;}
    public string destinationCountry { get; set; }
}

