How to merge elements from two XML files?
- by Googler
Hi all,
I need a c# lang code to merge two xml files into one, from the specified content.
XML FILE 1 :
 <exchange-documents>
    <documentlegal>
      <bibliographic-data>        
          <applicants>
              <applicant-name>
                <name>CENTURY PRODUCTS CO [US]</name>
              </applicant-name>                         
          </applicants>       
       </bibliographic-data>
    </documentlegal>
  </exchange-documents>
XML FILE 2:
<exchange-documents>
    <documentpatent>
      <bibliographic-data>        
          <applicants>
              <applicant-name>
                <name>CENTURY PRODUCTS CO [US]</name>
              </applicant-name>                         
          </applicants>       
       </bibliographic-data>
    </documentpatent>
  </exchange-documents>
I need to read the above two xml files and write it into a new xml files with selected elements?
OUTPUT XML:
<documentlegal>
          <bibliographic-data>        
              <applicants>
                  <applicant-name>
                    <name>CENTURY PRODUCTS CO [US]</name>
                  </applicant-name>                         
              </applicants>       
           </bibliographic-data>
        </documentlegal>
  <documentpatent>
          <bibliographic-data>        
              <applicants>
                  <applicant-name>
                    <name>CENTURY PRODUCTS CO [US]</name>
                  </applicant-name>                         
              </applicants>       
           </bibliographic-data>
        </documentpatent>
I dont need the exchnage document element. 
Can anyone provide me a c# code to achiev the above scenario?