title: What is the fastest/most efficient way to read this XML to Dictionary (Linq or something else?)
body: <p>I am very new to parsing XML, and I started learning about linq which I think might be the best solution here. I am mostly interested in performance as the application I am creating will read stock exchange prices, which sometimes can change very rapidly.
  I receive following message from the server:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
      &lt;events&gt;
          &lt;header&gt;
              &lt;seq&gt;0&lt;/seq&gt;
          &lt;/header&gt;
          &lt;body&gt;
              &lt;orderBookStatus&gt;
                  &lt;id&gt;100093&lt;/id&gt;
                  &lt;status&gt;Opened&lt;/status&gt;
              &lt;/orderBookStatus&gt;
              &lt;orderBook&gt;
                  &lt;instrumentId&gt;100093&lt;/instrumentId&gt;
                  &lt;bids&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1357.1&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1357.0&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1356.9&lt;/price&gt;
                          &lt;quantity&gt;71&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1356.8&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                  &lt;/bids&gt;
                  &lt;offers&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1357.7&lt;/price&gt;
                          &lt;quantity&gt;51&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1357.9&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1358.0&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1358.1&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                      &lt;pricePoint&gt;
                          &lt;price&gt;1358.2&lt;/price&gt;
                          &lt;quantity&gt;20&lt;/quantity&gt;
                      &lt;/pricePoint&gt;
                  &lt;/offers&gt;
                  &lt;lastMarketClosePrice&gt;
                      &lt;price&gt;1356.8&lt;/price&gt;
                      &lt;timestamp&gt;2011-05-03T20:00:00&lt;/timestamp&gt;
                  &lt;/lastMarketClosePrice&gt;
                  &lt;dailyHighestTradedPrice /&gt;
                  &lt;dailyLowestTradedPrice /&gt;
                  &lt;valuationBidPrice&gt;1357.1&lt;/valuationBidPrice&gt;
                  &lt;valuationAskPrice&gt;1357.7&lt;/valuationAskPrice&gt;
                  &lt;lastTradedPrice&gt;1328.1&lt;/lastTradedPrice&gt;
                  &lt;exchangeTimestamp&gt;1304501070802&lt;/exchangeTimestamp&gt;
              &lt;/orderBook&gt;
          &lt;/body&gt;
      &lt;/events&gt;
  </code></pre>
  
  <p>My aim is to parse price point elements </p>
  
  <pre><code>&lt;pricePoint&gt;
        &lt;price&gt;1358.2&lt;/price&gt;
        &lt;quantity&gt;20&lt;/quantity&gt;
  &lt;/pricePoint&gt;
  </code></pre>
  
  <p>into dictionary of the following structure:</p>
  
  <pre><code>Dictionary&lt;double, PriceLevel&gt; 
  </code></pre>
  
  <p>where price should be a double and PriceLevel is a class </p>
  
  <pre><code>class PriceLevel
  {
       int bid;
       int offer;
  
       public PriceLevel(int b, int o)
       {
            bid = b;
            offer = o;
       }
  
  
  }
  </code></pre>
  
  <p>Depending on the element, in which each price point exists (either bids or offers) quantity should be assigned accordingly, i.e. if price point exists in bids, then quantity should be assigned to bid, and 0 to offer. On the opposite, if price point exists in offers, then quantity should be assigned to offer and 0 to bid.</p>
  
  <p>I hope my explanation is clear, however if you have any problems understanding it, please do not hesitate to ask for clarification in comments.
  I would greatly appreciate help in solving this problem.</p>
  
  <p>+++++++++++++++++++++++++++++++++++++++++
  Update:</p>
  
  <p>I have gone deeper into the stream I am trying to read, and it is not going to be as simple as I expected. I found out, that the stream will not always contain the whole document, therefore I will have to read it using XmlReader to process the stream on the ongoing basis. In this case, how can I read bids and offers? I have something like this:</p>
  
  <p>StreamReader sr = new StreamReader("..\..\videos.xml");</p>
  
  <pre><code>        XmlReader xmlReader = XmlReader.Create(sr);
          while (xmlReader.Read())
          {
              if (xmlReader.HasValue)
              {
                  OnXmlValue(this, new MessageEventArgs(true, xmlReader.Value));//saxContentHandler.Content(xmlReader.Value);
              }
              else
              {
                  if (xmlReader.IsEmptyElement)
                  {
                      OnStartElement(this, new MessageEventArgs(false, xmlReader.Name));
                      OnEndElement(this, new MessageEventArgs(false, xmlReader.Name));
                  }
                  else if (xmlReader.IsStartElement())
                  {
                      OnStartElement(this, new MessageEventArgs(false, xmlReader.Name));
                  }
                  else
                  {
                      OnEndElement(this, new MessageEventArgs(false, xmlReader.Name));
                  }
              }
          }
  </code></pre>
  
  <p>but I am struggling to link element name to its value ... ie, how can I know which bid price point I am currently reading and if this exists in bids or offers?
  Thank you for help</p>