I have two XMLs
File1.xml It contains mapping for the IP need to copied multiple times and replacing the value with given.
<baseNode>
<internal ip="192.168.1.1">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="192.168.1.2">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
</baseNode>
File2.xml
<IPMappings>
<sourceIP value="192.168.1.1">
<replacement>10.66.33.22</replacement>
<replacement>10.66.33.44</replacement>
</sourceIP>
<sourceIP value="192.168.1.2">
<replacement>10.66.34.22</replacement>
<replacement>10.66.34.44</replacement>
</sourceIP>
</IPMappings>
Resulting XML should be:
<baseNode>
<internal ip="10.66.33.22">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.33.44">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.34.22">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.34.44">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
</baseNode>
How can I use XSLT to do this?