abdelwaheb ammar

abdelwaheb ammar

  • 1.7k
  • 319
  • 84k

Add XElement to another XElement in specific location

Feb 7 2020 4:17 AM
My XML
  1. <Bank>  
  2.  <Customer id="0">  
  3.   <Accounts>  
  4.    <Account id="0" />  
  5.    <Account id="1" />                        
  6.   </Accounts>  
  7.  </Customer>  
  8.   <Customer id="2">  
  9.   <Accounts>  
  10.    <Account id="0" />                      
  11.   </Accounts>  
  12.  </Customer>  
  13. </Bank>  
i want to add  new account element before customer id=2.
i have this xml in xelement and i want to add other xelement to the first. how can do that?
Thanks for the help. 
 

Answers (1)