XML : How to add XML inner elements using C# and LINQ to XML

from the solution which I found on the link below (How to add new element below existing element using xml Document).

How to add new element below existing element using xml Document

How if I need to add multiple sub element inside Records element, and the output should look like this:

  <NonFuel>      <Desc>Non-Fuel</Desc>      <Description>      </Description>      <Quantity/>      <Amount/>      <Additional/>      <Dispute>0</Dispute>      **<Records>        <ARecords>            <AInnerRecords>                     <ASubInner>SA78900</ASubInner>            </AInnerRecords>        </ARecords>        <BRecords>            <BInnerRecords>                     <BSubInner>SA78900</BSubInner>            </BInnerRecords>        </BRecords>        <CRecords>            <CInnerRecords>                     <CSubInner>SA78900</CSubInner>            </CInnerRecords>        </CRecords>      </Records>**  </NonFuel>    

No comments:

Post a Comment