The buyer and the seller are responsible for the payment of their own respective legal fees. The buyer's lawyer is responsible for transferring the title into the buyer's name and buyer pays the costs to have this done. If the buyer is getting a new mortgage he is responsible for payment of legal fees for the preparation and registration of the mortgage documents. While the mortgage lender reserves the right to appoint its own lawyer to prepare and register the mortgage documents, it will generally, upon request, allow the buyer's lawyer to do so.
The seller is responsible for payment of his lawyer's legal fees including costs incurred by his lawyer for title searches, tax searches, discharging the existing mortgage and discharging other caveats that are not assumed by the buyer.
You should discuss legal fees when you first contact your lawyer. He will be able to review the various aspects of the transaction and provide you with a close estimate of the legal fees, GST and other costs which you may incur.