need xslt code that convert html table to xml
this is my html code.
<html>
<head>
<style>h1{color:orange;text-align:center;}</style>
</head>
<body>
<h1>HTML example!</h1>
<p>This is a paragraph.</p>
<table>
<tr>
<td>1</td>
<td>Kim</td>
<td>Kardashian</td>
<td>39</td>
</tr>
<tr>
<td>2</td>
<td>Ariana</td>
<td>Grande</td>
<td>26</td>
</tr>
<tr>
<td>3</td>
<td>Cristiano</td>
<td>Ronaldo</td>
<td>35</td>
</tr>
<tr>
<td></td>
</tr>
</table>
</body>
</html>
the output of xml is:
<root>
<rows>
<col1>1</col1>
<col2>Kim</col2>
<col3>Kardashian</col3>
<col4>39</col4>
</rows>
<rows>
<col1>2</col1>
<col2>Ariana</col2>
<col3>Grande</col3>
<col4>26</col4>
</rows>
<rows>
<col1>3</col1>
<col2>Cristiano</col2>
<col3>Ronaldo</col3>
<col4>35</col4>
</rows>
</root>
I need required XSLT format to get this output xml with the input of HTML