I want to convert records in a table into XML in sql server as shown below.

Table

```
countryid   stateid siteid  value
1   1   1   11
1   1   2   22
1   2   1   55
1   2   2   66
2   1   1   111
2   1   2   222
2   2   1   555
2   2   2   666
3   1   1   100
3   1   2   200
3   2   1   500
3   2   2   600

```

I want to convert this data into XML as shown below.

```
<data>  
    <countrydata> 
        <countryid> 1 </countryid> 
        <stateid> 1 </stateid>
        <siteid> 1 </siteid>
        <value> 11 </value>
    </countrydata>
    <countrydata> 
        <countryid> 1 </countryid> 
        <stateid> 1 </stateid>
        <siteid> 2 </siteid>
        <value> 22 </value>
    </countrydata>
    <countrydata> 
        <countryid> 1 </countryid> 
        <stateid> 2 </stateid>
        <siteid> 1 </siteid>
        <value> 55 </value>
    </countrydata>
    <countrydata> 
        <countryid> 1 </countryid> 
        <stateid> 2 </stateid>
        <siteid> 2 </siteid>
        <value> 66 </value>
    </countrydata>
</data>

```

This XML is what I expect from records with countryid = 1..

Similarly I need different XML records with different countryids.