title: Parsing XML using C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9535320/amazon-marketplace-xml-parsing">Amazon Marketplace XML parsing</a>  </p>
  </blockquote>
  
  
  
  <p>I am new to parsing XML in C# and I have some data from Amazon MWS library that is displayed below. I need to parse out various ItemAttributes such as ItemDimensions. I am use to JSON responses so I am not sure how to apply this to XML. Would it be possible from someone to point me in the right direction? I have Googled XML Parsing with C# but not valuable results were found to help me complete my tasks.</p>
  
  <pre><code>&lt;GetMatchingProductResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01"&gt;
  &lt;GetMatchingProductResult ASIN="1430225491" status="Success"&gt;
    &lt;Product&gt;
      &lt;Identifiers&gt;
        &lt;MarketplaceASIN&gt;
          &lt;MarketplaceId&gt;ATVPDKIKX0DER&lt;/MarketplaceId&gt;
          &lt;ASIN&gt;1430225491&lt;/ASIN&gt;
        &lt;/MarketplaceASIN&gt;
      &lt;/Identifiers&gt;
      &lt;AttributeSets&gt;
        &lt;ns2:ItemAttributes xml:lang="en-US"&gt;
          &lt;ns2:Author&gt;Troelsen, Andrew&lt;/ns2:Author&gt;
          &lt;ns2:Binding&gt;Paperback&lt;/ns2:Binding&gt;
          &lt;ns2:Brand&gt;Apress&lt;/ns2:Brand&gt;
          &lt;ns2:Edition&gt;5&lt;/ns2:Edition&gt;
          &lt;ns2:ItemDimensions&gt;
            &lt;ns2:Height Units="inches"&gt;9.21&lt;/ns2:Height&gt;
            &lt;ns2:Length Units="inches"&gt;7.48&lt;/ns2:Length&gt;
            &lt;ns2:Width Units="inches"&gt;2.52&lt;/ns2:Width&gt;
            &lt;ns2:Weight Units="pounds"&gt;5.80&lt;/ns2:Weight&gt;
          &lt;/ns2:ItemDimensions&gt;
          &lt;ns2:IsAutographed&gt;false&lt;/ns2:IsAutographed&gt;
          &lt;ns2:IsEligibleForTradeIn&gt;true&lt;/ns2:IsEligibleForTradeIn&gt;
          &lt;ns2:IsMemorabilia&gt;false&lt;/ns2:IsMemorabilia&gt;
          &lt;ns2:Label&gt;Apress&lt;/ns2:Label&gt;
          &lt;ns2:Languages&gt;
            &lt;ns2:Language&gt;
              &lt;ns2:Name&gt;english&lt;/ns2:Name&gt;
              &lt;ns2:Type&gt;Unknown&lt;/ns2:Type&gt;
            &lt;/ns2:Language&gt;
            &lt;ns2:Language&gt;
              &lt;ns2:Name&gt;english&lt;/ns2:Name&gt;
              &lt;ns2:Type&gt;Original Language&lt;/ns2:Type&gt;
            &lt;/ns2:Language&gt;
            &lt;ns2:Language&gt;
              &lt;ns2:Name&gt;english&lt;/ns2:Name&gt;
              &lt;ns2:Type&gt;Published&lt;/ns2:Type&gt;
            &lt;/ns2:Language&gt;
          &lt;/ns2:Languages&gt;
          &lt;ns2:ListPrice&gt;
            &lt;ns2:Amount&gt;59.99&lt;/ns2:Amount&gt;
            &lt;ns2:CurrencyCode&gt;USD&lt;/ns2:CurrencyCode&gt;
          &lt;/ns2:ListPrice&gt;
          &lt;ns2:Manufacturer&gt;Apress&lt;/ns2:Manufacturer&gt;
          &lt;ns2:NumberOfItems&gt;1&lt;/ns2:NumberOfItems&gt;
          &lt;ns2:NumberOfPages&gt;1752&lt;/ns2:NumberOfPages&gt;
          &lt;ns2:PackageDimensions&gt;
            &lt;ns2:Height Units="inches"&gt;2.60&lt;/ns2:Height&gt;
            &lt;ns2:Length Units="inches"&gt;9.20&lt;/ns2:Length&gt;
            &lt;ns2:Width Units="inches"&gt;7.50&lt;/ns2:Width&gt;
            &lt;ns2:Weight Units="pounds"&gt;5.80&lt;/ns2:Weight&gt;
          &lt;/ns2:PackageDimensions&gt;
          &lt;ns2:PartNumber&gt;9781430225492&lt;/ns2:PartNumber&gt;
          &lt;ns2:ProductGroup&gt;Book&lt;/ns2:ProductGroup&gt;
          &lt;ns2:ProductTypeName&gt;ABIS_BOOK&lt;/ns2:ProductTypeName&gt;
          &lt;ns2:PublicationDate&gt;2010-05-14&lt;/ns2:PublicationDate&gt;
          &lt;ns2:Publisher&gt;Apress&lt;/ns2:Publisher&gt;
          &lt;ns2:SmallImage&gt;
            &lt;ns2:URL&gt;http://ecx.images-amazon.com/images/I/51h9Sju5NKL._SL75_.jpg&lt;/ns2:URL&gt;
            &lt;ns2:Height Units="pixels"&gt;75&lt;/ns2:Height&gt;
            &lt;ns2:Width Units="pixels"&gt;61&lt;/ns2:Width&gt;
          &lt;/ns2:SmallImage&gt;
          &lt;ns2:Studio&gt;Apress&lt;/ns2:Studio&gt;
          &lt;ns2:Title&gt;Pro C# 2010 and the .NET 4 Platform&lt;/ns2:Title&gt;
        &lt;/ns2:ItemAttributes&gt;
      &lt;/AttributeSets&gt;
      &lt;Relationships/&gt;
      &lt;SalesRankings&gt;
        &lt;SalesRank&gt;
          &lt;ProductCategoryId&gt;book_display_on_website&lt;/ProductCategoryId&gt;
          &lt;Rank&gt;43011&lt;/Rank&gt;
        &lt;/SalesRank&gt;
        &lt;SalesRank&gt;
          &lt;ProductCategoryId&gt;697342&lt;/ProductCategoryId&gt;
          &lt;Rank&gt;36&lt;/Rank&gt;
        &lt;/SalesRank&gt;
        &lt;SalesRank&gt;
          &lt;ProductCategoryId&gt;3967&lt;/ProductCategoryId&gt;
          &lt;Rank&gt;53&lt;/Rank&gt;
        &lt;/SalesRank&gt;
        &lt;SalesRank&gt;
          &lt;ProductCategoryId&gt;4013&lt;/ProductCategoryId&gt;
          &lt;Rank&gt;83&lt;/Rank&gt;
        &lt;/SalesRank&gt;
      &lt;/SalesRankings&gt;
    &lt;/Product&gt;
  &lt;/GetMatchingProductResult&gt;
  &lt;ResponseMetadata&gt;
    &lt;RequestId&gt;440cdde0-fa76-4c48-bdd1-d51a3b467823&lt;/RequestId&gt;
  &lt;/ResponseMetadata&gt;
  &lt;/GetMatchingProductResponse&gt;
  </code></pre>