A new nitrogen containing compound named xylactam B (2), along with a further eight known compounds, ceramide 2a, cerebroside B, cyclo(prolyl,valyl), marmesin, 5-methoxycarbonylmellein, 5-methylmellein, polypropylene glycol and p-hydroxybenzoic acid, were isolated from an endophytic Xylaria sp. The structure elucidation of the new compound and the other isolates was carried out with the help of spectroscopic analyses and databases.