XML Whitespaces/Unwanted Characters Could anyone help on how to remove white spaces from an XML file?

I  used the following code that i got from  Mikael Eriksson on Stack Exchange to extract the site id:

cast(msg as xml).value('(/DLR_NOTIFICATION/siteid/text())[1]', 'int') AS SiteID


from the following xml:

&lt;DLR_NOTIFICATION&gt;
  &lt;kid&gt;204122&lt;/kid&gt;
  &lt;siteid&gt; 7929 &lt;/siteid&gt;
  &lt;transid&gt;1c3508e7-f80e-44de-bdf6-3687ff3da84a&lt;/transid&gt;
  &lt;service&gt;00000&lt;/service&gt;&lt;mobile&gt;447500000&lt;/mobile&gt;
  &lt;msisdntype&gt;IPAlias&lt;/msisdntype&gt;
  &lt;operator&gt;Three&lt;/operator&gt;
  &lt;status&gt;100&lt;/status&gt;
  &lt;tariff&gt;600&lt;/tariff&gt;
  &lt;billingroute&gt;ImpulsePay&lt;/billingroute&gt;
  &lt;purpose&gt;IMPerial NOTIFICATION&lt;/purpose&gt;
  &lt;tracking&gt;
    &lt;aff&gt;14_z&lt;/aff&gt;
    &lt;param&gt;undefined&lt;/param&gt;
    &lt;paramdetails&gt;kp=xkpgbadu201409232240100000000000000000000000231&lt;/paramdetails&gt;
  &lt;/tracking&gt;
&lt;/DLR_NOTIFICATION&gt;


How do I trim the whitespaces or any unwanted characters? Or if there is any better way of dealing with this?

I realised that some of this XML have got whitespaces within as shown above in the siteid had caused the below error message


  Msg 245, Level 16, State 1, Line 100 Conversion failed when converting
  the nvarchar value ' 7929 ' to data type int.
This actually does the job by changing int to nvarchar(10) from the script that was posted by Mikael Eriksson: 

select cast(msg as xml).value('(/DLR_NOTIFICATION/siteid/text())[1]','nvarchar(10)')SiteID