If you interested in how this is achieved using Muenchian Grouping, which is a common technique in XSLT, you first need to define a 'key' to identify duplicate books within a row.
<xsl:key
name="books"
match="book"
use="concat(concat(../../Row_ID, '#'), concat(concat(BookType, '#'), BookName))" />
In this I am achieving this using a concatenated key of RowID, BookType and BookName. The key will contain a list of books all with that particular value of key. Do note the use of the # character as the joining character. If there is any chance of # appearing in your XML, you will need to pick another character (or string).
Now when you are matching on book elements, you can check for duplicates like so
<xsl:variable
name="lookup"
select="concat(concat(../../Row_ID, '#'), concat(concat(BookType, '#'), BookName))" />
<xsl:if test="generate-id() = generate-id(key('books', $lookup)[1])">
In other words, is this book element the first element in our key.
Here is the full XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:key
name="books"
match="book"
use="concat(concat(../../Row_ID, '#'), concat(concat(BookType, '#'), BookName))"/>
<xsl:template match="book">
<xsl:variable name="lookup" select="concat(concat(../../Row_ID, '#'), concat(concat(BookType, '#'), BookName))"/>
<xsl:if test="generate-id() = generate-id(key('books', $lookup)[1])">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Also note the use of the identity transform so that other nodes can be copied without having to explicitly reference them. When this XSLT is applied to your input, the following output is generated:
<RowIDWithListOfBooks xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<Row_ID>ADOA-XssK</Row_ID>
<ListOfBookInfo>
<book>
<BookType>Brand</BookType>
<BookName>jon</BookName>
</book>
</ListOfBookInfo>
</RowIDWithListOfBooks>
EDIT: I have amended the XSLT to remove an unnecessary template match.