title: c# XML transformation
body: <p>i need help for below xml. I wonder how can I bring the XML below, I've been trying for a very long time, but it didn't work. I would be grateful if you could help with this.</p>
  <p>I can do the same thing in php, but since my data is a little big, php takes a lot of time, I read the file from the web service with c# and save it as xml, but it didn't work out as I wanted.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ResultOfProductList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;ServerCode&gt;kenan&lt;/ServerCode&gt;
  &lt;ClientCode&gt;B124565&lt;/ClientCode&gt;
  &lt;Username&gt;karanfil&lt;/Username&gt;
  &lt;ClientIPAddress&gt;78.135.235.3&lt;/ClientIPAddress&gt;
  &lt;Successful&gt;true&lt;/Successful&gt;
  &lt;RequestDate&gt;2022-07-22T12:28:54.6238843+03:00&lt;/RequestDate&gt;
  &lt;ElapsedTimeMS&gt;17&lt;/ElapsedTimeMS&gt;
  &lt;MethodType&gt;GetAllProductsByParts&lt;/MethodType&gt;
  &lt;Result EndOfProducts="false"&gt;
  &lt;CustomerCode&gt;B124565&lt;/CustomerCode&gt;
  &lt;CustomerName&gt;kenan&lt;/CustomerName&gt;
  &lt;Date&gt;2022-07-22T12:28:54.6238843+03:00&lt;/Date&gt;
  &lt;Brands&gt;
  &lt;Brand ID="174" Lang="tr" BrandName="PARTSMALL-KORE" StandardName=""/&gt;
  &lt;/Brands&gt;
  &lt;Products&gt;
  &lt;Product ID="134898" BrandID="174" ProductCode="KR-PML-PTA-086" ProducerCode="" MinOrderAmount="1" PiecesInBox="1" Unit="PCE" New="false"&gt;
  &lt;ProductNames&gt;
  &lt;ProductName Lang="tr"&gt;VITES HALATI ( HYUNDAI : ACCENT 95-00 )&lt;/ProductName&gt;
  &lt;/ProductNames&gt;
  &lt;BaseOeNr&gt;43794-22000&lt;/BaseOeNr&gt;
  &lt;Pricing&gt;
  &lt;ListPriceCurrency&gt;USD&lt;/ListPriceCurrency&gt;
  &lt;LocalCurrency&gt;TLY&lt;/LocalCurrency&gt;
  &lt;CurrencyRate&gt;17.6599&lt;/CurrencyRate&gt;
  &lt;ListPriceWoVAT&gt;31.24&lt;/ListPriceWoVAT&gt;
  &lt;LocalListPriceWVat&gt;651.0004&lt;/LocalListPriceWVat&gt;
  &lt;LocalListPriceWoVat&gt;551.695251&lt;/LocalListPriceWoVat&gt;
  &lt;LocalNetPriceWVat&gt;377.580261&lt;/LocalNetPriceWVat&gt;
  &lt;LocalNetPriceWoVat&gt;319.983246&lt;/LocalNetPriceWoVat&gt;
  &lt;Discount1&gt;42&lt;/Discount1&gt;
  &lt;Discount2&gt;0&lt;/Discount2&gt;
  &lt;Discount3&gt;0&lt;/Discount3&gt;
  &lt;Discount4&gt;0&lt;/Discount4&gt;
  &lt;Discount5&gt;0&lt;/Discount5&gt;
  &lt;Discount6&gt;0&lt;/Discount6&gt;
  &lt;InDiscount&gt;false&lt;/InDiscount&gt;
  &lt;/Pricing&gt;
  &lt;Stocks&gt;
  &lt;Stock WarehouseID="1" Equality="Eq"&gt;0&lt;/Stock&gt;
  &lt;Stock WarehouseID="7" Equality="Eq"&gt;0&lt;/Stock&gt;
  &lt;Stock WarehouseID="4" Equality="Eq"&gt;0&lt;/Stock&gt;
  &lt;Stock WarehouseID="2" Equality="Eq"&gt;0&lt;/Stock&gt;
  &lt;Stock WarehouseID="5" Equality="Eq"&gt;0&lt;/Stock&gt;
  &lt;/Stocks&gt;
  &lt;/Product&gt;
  &lt;/Result&gt;
  &lt;/ResultOfProductList&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><strong>Desired output</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;Products&gt;
       &lt;Product&gt;
            &lt;ID&gt;134898&lt;/ID&gt;
            &lt;BrandID&gt;174&lt;/BrandID&gt;
            &lt;BaseOeNr&gt;43794-22000&lt;/BaseOeNr&gt;
            &lt;ProductCode&gt;KR-PML-PTA-086&lt;/ProductCode&gt;
            &lt;ProductName&gt;VITES HALATI ( HYUNDAI : ACCENT 95-00 )&lt;/ProductName&gt;
            &lt;LocalCurrency&gt;TLY&lt;/LocalCurrency&gt;
            &lt;LocalNetPriceWVat&gt;377.580261&lt;/LocalNetPriceWVat&gt;
            &lt;Stocks&gt;WarehouseID=1 + WarehouseID=7 + WarehouseID=4 + WarehouseID=2 + WarehouseID=5 &lt;/Stocks&gt;
  &lt;/Product&gt;
  &lt;/Products&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/5IRJb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5IRJb.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/dDe5L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dDe5L.png" alt="enter image description here" /></a></p>