concate string with specific separater at specific position in sql server : hi i want to generate xml from from table column value

    position  value
    1.1       a
    1.2       b
    2.1       c
    2.1.2     d
    3.1       e
    3.1.2     f
    3.1.2.1   g
Output like this

    <1>
      <2>b</2>
    </1>
    <2>c
       <1>
         <2>d</2>
       </1>
    </2>
    <3>e
       <1>
         <2>f
           <1>g</1> 
        </2>
       </1>
    </3>

i dont know it is possible or not inshort i want multilavel xml based on nth node
