OK, first up, to use XSLT with Java, see the answer to this question:
java xslt tutorial
The XSLT you would need is as follows (disclaimer: I'm learning XSLT myself so, if anyone has any better solutions, please post them and comment here!)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Template 1 (see below) -->
<xsl:template match="/">
<xsl:element name="Root">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<!-- Template 2 (see below) -->
<xsl:template match="KT2">
<xsl:element name="KT1">
<xsl:copy>
<xsl:apply-templates select="text()" />
</xsl:copy>
</xsl:element>
</xsl:template>
<!-- Template 3 (see below) -->
<xsl:template match="text()">
<xsl:copy />
</xsl:template>
</xsl:stylesheet>
The results of applying this XSLT to your input XML are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<KT1>
<KT2>String1</KT2>
</KT1>
<KT1>
<KT2>String2</KT2>
</KT1>
.
.
.
</Root>
My understanding of the way XSLT works is that it will apply templates in order of specificity. A dry run through the XLST above would be as follows:
1) The root of the XML document matches exactly to Template 1 - this tells it to output a root node and then carry on processing other elements
2) The first KT1 element doesn't match to any templates, so is not output
3) The first KT2 child of the first KT1 element matches to Template 2 - this tell it output a KT1 node, and then copy the found KT2 node and then to continue processing
4) The text of the KT2 node matches to Template 3, which just copies it out
5) The second KT2 child of the first KT1 element matches to Template 2 - and so on
The XSLT above is quite specific, it can easily be made more general - google "XSLT Identity Transforms" for a good start.