A Dublin man has been charged with the murder of Mr Donnelly, who was burnt to death while living rough in the Phoenix Park.
Ciaran Moran (27) was remanded in custody after he appeared in court charged with killing Mr Donnelly, whose body was found near the Wellington monument last Friday.
Gardai on routine patrol discovered the victim, who had burned to death in a sleeping bag and suffered facial injuries.
Judge Ann Ryan adjourned the case for a week at Dublin District Court and made a recommendation that the accused receives medical attention while in custody.
Moran, with a last address at Camden Hall, Camden Street, is charged with murdering Mr Donnelly Wellington Road, Phoenix Park on November 29.
Detetctive Sergeant Thomas Lynch of Cabra Station told the court he arrested the defendant at Finglas Station last night at 10.41pm.
He was charged in Sgt Lynch's presence at 11.55pm and made no reply after caution. He was detained under Section 4 of the Criminal Justice Act 1984.
Following consultations with the office of the DPP, a direction was given to charge Moran with murder, Det Sgt Lynch said.
He applied for the defendant to be remanded in custody for a week.
Judge Ann Ryan granted free legal aid after Defence Solicitor Andrew Vallely handed a statement of the defendant's means in to court, and there was no objection by gardai.
He also applied for medical attention for his client while in custody. Judge Ryan recommended "any medical attention" that the accused may require, after hearing that this was an "ongoing situation".
She remanded Moran in custody to appear in Cloverhill District Court on December 10.
The defendant, wearing a grey top and black tracksuit bottoms, and who had a visible head injury, did not address the court during the brief hearing.
A post-mortem examination on the body of Mr Donnelly, who formerly lived in Tallaght, had indicated that he had not been sleeping rough for long.
Gardai have said Mr Donnelly, who was in his late 30s, had opted to live outdoors in the Phoenix Park on occasions as a "lifestyle" choice and was not a typical homeless person.
Officers last night confirmed yesterday that he had owned a house and had access to money.
According to gardai, he had around €130,000 in a bank account after selling his home eight years ago.
Gardai learned the probable identity of the dead man at the weekend but were awaiting the outcome of DNA tests and an examination of dental records to confirm it.
Mr Donnelly has no immediate family, apart from his mother, who is currently ill in hospital and cannot be interviewed by gardai.
Gardai said he had a number of addresses in Dublin in the past and had also been employed. He had not come to the attention of the gardai previously.
Another man and a 17-year-old girl have been arrested so far by gardai for questioning about the death.
The 17-year-old was being detained at Blanchardstown Garda Station this morning and the man was at Finglas.
But officers said there could be further arrests as they widened their enquiries.
By Andrew Phelan