Я согласен с marc_s У XML нет хорошей схемы.
Самое близкое, что я мог получить:
SELECT tab.col.value('./hotel_ref[1]','varchar(100)') AS 'hotel_ref',
fac.value('(.)[1]','varchar(100)') AS 'HotelFacilityID',
ROWID=IDENTITY(int,1,1)
into #facilitiesid
FROM @Details.nodes('/hotels/hotel') AS tab(col)
cross apply col.nodes('.//id') a(fac)
SELECT tab.col.value('../hotel_ref[1]','varchar(100)') AS 'hotel_ref',
fac.value('(.)[1]','varchar(100)') AS 'HotelFacilityName',
ROWID=IDENTITY(int,1,1)
into #facilitiesnames
FROM @Details.nodes('//hotels/hotel/hotel_facilities') AS tab(col)
cross apply col.nodes('.//name') a(fac)
select i.hotel_ref, HotelFacilityID, HotelFacilityName
from #facilitiesid i
inner join #facilitiesnames n
on i.rowid = n.rowid