The court shall consider whether the interests of the child require the appointment of counsel. If the court finds that the interests of the child require representation by counsel, the court shall appoint counsel to represent the child, whether or not the child is able to afford counsel. The child shall not be present in court unless the child so requests or the court so orders.
Ca. Fam. Code § 7861