donate comments/suggestions/bugs a leap of faith?
By using dbfiddle, you agree to license everything you submit by Creative Commons CC0

create table pn( id int identity(1,1) primary key, proj_id int not null, pn varchar(10) not null, mtyp_id int not null);
show plan split remove clear

insert into pn (proj_id, pn, mtyp_id) values (1, 'Cc',1), (1, 'Bb',2), (1, 'Aa',3), (2, 'Dd',2), (3, 'Ee',1), (3, 'Ff',3);
show plan split remove clear
6 rows affected

create table mscht( id_mtyp int identity(1,1) primary key, masch varchar(10) not null);
show plan split remove clear

insert into mscht (masch) values ('WSG'), ('HSG'), ('GSF'), ('WIP');
show plan split remove clear
4 rows affected

create table docmap( ID_DM int identity(1,1) primary key, DN_ID int not null, PN_ID int not null);
show plan split remove clear

insert into docmap (DN_ID, PN_ID) values (1, 1), (1,2), (2,3), (3,4), (4,5), (5,6);
show plan split remove clear
6 rows affected

select DN_ID, stuff( ( select distinct char(13) + char(10) + 'PN ' + pn + ' (', masch, ') ' from pn inner join mscht on id_mtyp = id_mtyp inner join docmap on id = mtyp_id where proj_id = t.proj_id order by 1 for xml path(''), type).value('.', 'varchar( max )' ), 1, 2, '' ) as zeile from pn t inner join docmap on t.id = PN_ID
show plan split remove clear
DN_IDzeile
1PN Aa (GSF) PN Aa (HSG) PN Aa (WIP) PN Aa (WSG) PN Bb (GSF) PN Bb (HSG) PN Bb (WIP) PN Bb (WSG) PN Cc (GSF) PN Cc (HSG) PN Cc (WIP) PN Cc (WSG)
1PN Aa (GSF) PN Aa (HSG) PN Aa (WIP) PN Aa (WSG) PN Bb (GSF) PN Bb (HSG) PN Bb (WIP) PN Bb (WSG) PN Cc (GSF) PN Cc (HSG) PN Cc (WIP) PN Cc (WSG)
2PN Aa (GSF) PN Aa (HSG) PN Aa (WIP) PN Aa (WSG) PN Bb (GSF) PN Bb (HSG) PN Bb (WIP) PN Bb (WSG) PN Cc (GSF) PN Cc (HSG) PN Cc (WIP) PN Cc (WSG)
3null
4null
5null