This style sheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:template match="/*">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:param name="pName"/>
<xsl:apply-templates>
<xsl:with-param name="pName" select="concat($pName,name(),'-')"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="text()">
<xsl:param name="pName"/>
<xsl:element name="{substring($pName,1,string-length($pName)-1)}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Conclusion:
<root>
<PNode-node1-node1Child>data</PNode-node1-node1Child>
<PNode-node1-node2Child>data</PNode-node1-node2Child>
<SecondNode-node1-node1Child-child>data</SecondNode-node1-node1Child-child>
</root>
Update : if there can be empy nodes ...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:template match="/*">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:param name="pName"/>
<xsl:apply-templates>
<xsl:with-param name="pName" select="concat($pName,name(),'-')"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*[not(*)]">
<xsl:param name="pName"/>
<xsl:element name="{$pName}{name()}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
: .
user357812