views:

44

answers:

0

I have the following xml:

<DOCUMENT>
  <ARTICLE>
   <META name="bbb" value="7086" score="0.58" key="6007"/>
   <META name="ccc" value="7089" score="0.58" key="6008"/>
   <META name="ddd" value="7087" score="0.58" key="6009"/>
  </ARTICLE>
</DOCUMENT>

I need to use linq to xml and an xdocument to allow users in an asp.net page to edit the name attributes and add then merge the new xmlelement into another xdocument as a child element. So the result may look something like:

<ANOTHERDOCUMENT>  
    <ANOTHERDOCUMENTARTICLE>    
     <META name="bbb" value="7086" score="0.58" key="6007"/>    
     <META name="changedccc" value="7089" score="0.58" key="6008"/>    
     <META name="dddaddedsomething" value="7087" score="0.58" key="6009"/>  
    </ANOTHERDOCUMENTARTICLE>
</ANOTHERDOCUMENT>

Can anyone suggest the cleanest way to do this with linq to xml / xdocument approach?