# Merging two xml files

**URL:** <https://forum.kirupa.com/t/merging-two-xml-files/327279>\
**Category:** Uncategorized\
**Created:** [February 18, 2012, 6:07am UTC](https://forum.kirupa.com/t/merging-two-xml-files/327279 "2012-02-18T06:07:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronmac](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ronmac](https://forum.kirupa.com/u/ronmac)\
**Post date:** [February 18, 2012, 6:07am UTC](https://forum.kirupa.com/t/merging-two-xml-files/327279/1 "2012-02-18T06:07:46Z")

</div>

Hello all. I want to merge these two xml files below so that I get the merged xml.

Thanks in advance

\*\*file1 \*\*

\<players\>  
\<player\>  
\<player\_id\>5197\</player\_id\>  
\<name\>Brad Walch\</name\>  
\<shoots\>L\</shoots\>  
\</player\>  
\<player\>  
\<player\_id\>5198\</player\_id\>  
\<name\>Ted Jones\</name\>  
\<shoots\>L\</shoots\>  
\</player\>

\<player\>  
\<player\_id\>5199\</player\_id\>  
\<name\>Eric Phillips\</name\>  
\<shoots\>R\</shoots\>  
\</player\>  
\</players\>

**file2**

\<players\>  
\<player\>  
\<player\_id\>5197\</player\_id\>  
\<name\>Brad Walch\</name\>  
\<position\>D\</position\>  
\</player\>  
\<player\>  
\<player\_id\>5198\</player\_id\>  
\<name\>Ted Jones\</name\>  
\<position\>LW\</position\>  
\</player\>

\<player\>  
\<player\_id\>5199\</player\_id\>  
\<name\>Ted Jones\</name\>  
\<position\>RW\</position\>  
\</player\>  
\</players\>

**merged file**

\<players\>  
\<player\>  
\<player\_id\>5197\</player\_id\>  
\<name\>Brad Walch\</name\>  
\<shoots\>L\</shoots\>  
\<position\>D\</position\>  
\</player\>

\<player\>  
\<player\_id\>5198\</player\_id\>  
\<name\>Ted Jones\</name\>  
\<shoots\>L\</shoots\>  
\<position\>LW\</position\>  
\</player\>

\<player\>  
\<player\_id\>5199\</player\_id\>  
\<name\>Eric Phillips\</name\>  
\<shoots\>R\</shoots\>  
\<position\>RW\</position\>  
\</player\>  
\</players\>
