Parse message_body(XML) I know the contents of @message_body are:

&lt;inserted DocNo="xxxx99999"/&gt;


I want to put 'DocNo' into a variable I created @DocNo and have tried various this such as:

SET @DocNo = (SELECT ref.value('@DocNo', 'nvarchar(255)')
              FROM @message_body.nodes('//Sample_Message') T(ref))


with no luck. I don't have much experience parsing XML with SQL. Any suggestions?
DECLARE @docNo nvarchar(255)
DECLARE @message_body xml = N'&lt;inserted DocNo="12345"/&gt;'

SELECT
    @docNo = @message_body.value('/inserted[1]/@DocNo', 'nvarchar(255)')

SELECT @docNo