• Are you looking for something like the following?

    DECLARE @x XML

    SET @x =

    '

    '

    -- Total count of Nodes

    DECLARE @max-2 INT, @i INT

    SELECT

    @max-2 = @x.query('

    { count(/Employees/Employee) }

    ').value('e[1]','int')

    -- Set counter variable to 1

    SET @i = 1

    -- variable to store employee name

    DECLARE @EmpName VARCHAR(10)

    -- loop starts

    WHILE @i <= @max-2 BEGIN

    -- select "Name" to the variable

    SELECT

    @EmpName = x.value('Name[1]', 'VARCHAR(20)')

    FROM

    @x.nodes('/Employees/Employee[position()=sql:variable("@i")]')

    e(x)

    -- print the name

    PRINT @EmpName

    -- increment counter

    SET @i = @i + 1

    END

    .