• You need to increase the size of the variable:

    DECLARE @doc varchar(1000)

    It's WAY too small to hold the entire XML string...