我有两个 XML 文件,格式如下 File 1
<info>
<organization_id>123</organization_id>
<total_patients>5</total_patients>
</info>
<patients>
<patient>
<guid>1111</guid>
</patient>
<patient>
<guid>2222</guid>
</patient>
</patients>
文件 2
<info>
<organization_id>456</organization_id>
<total_patients>10</total_patients>
</info>
<patients>
<patient>
<guid>3333</guid>
</patient>
<patient>
<guid>4444</guid>
</patient>
</patients>
我想将这两个文件合并为一个,格式如下
输出文件
<info>
<total_patients>15</total_patients>
</info>
<organizations>
<organization>
<organization_id>123</organization_id>
<patients>
<patient>
<guid>1111</guid>
</patient>
<patient>
<guid>1111</guid>
</patient>
</patients>
</organization>
<organization>
<organization_id>456</organization_id>
<patients>
<patient>
<guid>4444</guid>
</patient>
<patient>
<guid>5555</guid>
</patient>
</patients>
</organization>
</organizations>
我将不胜感激任何建议。我一直在搜索谷歌,找不到与此类似的东西。谢谢