Using the following stylesheet
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="//*[starts-with(local-name(), 'RU')]//prop/@val">
<xsl:call-template name="replace-aorg" />
</xsl:template>
<xsl:template name="replace-aorg">
<xsl:param name="text" select="." />
<xsl:choose>
<xsl:when test="contains($text, 'a.org')">
<xsl:value-of select="substring-before($text, 'a.org')"/>
<xsl:text>b.com</xsl:text>
<xsl:call-template name="replace-aorg">
<xsl:with-param name="text" select="substring-after($text, 'a.org')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
and adjusting your XML document to
<doc>
<RU1>
<conf>
<prop name="a" val="http://a.org/a.html" />
</conf>
</RU1>
<RAU1>
<conf>
<prop name="a" val="http://a.org/a.html" />
</conf>
</RAU1>
<RU2>
<conf>
<prop name="a" val="http://a.org/a.html" />
</conf>
</RU2>
</doc>
Output:
$ xsltproc sty.xml doc.xml
<?xml version="1.0"?>
<doc>
<RU1>
<conf>
<prop name="a">http://b.com/a.html</prop>
</conf>
</RU1>
<RAU1>
<conf>
<prop name="a" val="http://a.org/a.html"/>
</conf>
</RAU1>
<RU2>
<conf>
<prop name="a">http://b.com/a.html</prop>
</conf>
</RU2>
</doc>
So from Perl, that would be something such as
system("xsltproc", "style.xsl", "doc.xml") == 0
or warn "$0: xsltproc exited " . ($? >> 8);