Please try the following solution based on XSLT.
It is using a so called Identity Transform pattern.
Notable points:
- The XSLT will copy the entire input XML as-is except the
<description> elements.
- Each
<description> elements will get value of the sibling <name>
element.
In the Notepad++ select the following option in the menu:
Plugins => XML Tools => XSL Transformation...
Input XML
<?xml version="1.0"?>
<root>
<item id="1">
<name>ABC</name>
<description>old text</description>
</item>
<item id="2">
<name>BBC</name>
<description>some text</description>
</item>
</root>
XSLT 1.0
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"
encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--Identity transform-->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="description">
<xsl:copy>
<xsl:value-of select="preceding-sibling::name"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Output XML
<root>
<item id="1">
<name>ABC</name>
<description>ABC</description>
</item>
<item id="2">
<name>BBC</name>
<description>BBC</description>
</item>
</root>