My way is very similare to Dwain's way, but I also added the distinct key word so there will be only 2 rows. I also didn't use the stuff function:
DECLARE @Tbl TABLE (Gender char(6), Name varchar(20), Age tinyint)
INSERT INTO @Tbl (Gender, Name, Age)
SELECT 'Male', 'John', 52
UNION ALL
SELECT 'Female', 'Joe', 33
UNION ALL
SELECT 'Male', 'Jim', 42
select distinct Gender,
cast((select Name + ' ' + cast(Age as char(2)) + ' ' FROM @Tbl t1 where t1.Gender = t2.Gender for xml path('')) as varchar(max)) as Det
from @Tbl t2
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/