How to Update a Node of XML Datatype Column with Data from same Table

Suppose, I have table with name "XMLData" with two column "StudentID " --> datatype int and "XMLColumndata" with datatype "xml"

StudentID              XMLCOlumnData

      24                    <UBO4>.....</UBO4>
      25                     <UBO4>.....</UBO4>

The format of my XML is:
  1. <UBO4 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
  2. <InvoiceID>0</InvoiceID>  
  3. <S1>Kanrad Home Health Inc  
  4. 1580 Broad Avenue  
  5. Belle Vernon, NY 15012</S1>  
  6. <S2 >100</S2>  
  7. <S3>26020</S3>  
  8. <S4>XXX</S4>  
  9. <S5>1234567890</S5>  
  10.  </UBO4>  
If you want to update "S2" node of xml with StudentID of that row.
this is the Solution:
  1. UPDATE XMLData SET XMLCOlumnData.modify('  
  2. replace value of  
  3. (/UBO4[1]/S2 [1]/text()[1])  
  4. with  
  5. (    sql:column("StudentID ") )  
  6. ')