select UniqueID, ID, Name, ( select Latitude, Longitude from tab1 where ID = t1.ID for XML RAW, ROOT('Metadata'))from tab1 t1