; and (2) in subsection (c), by amending paragraph (5) to read as follows: (5) Legal representation (A) Appointment or provision of counsel (i) In general As expeditiously as possible after an unaccompanied alien child is issued a notice to appear under section 239(a) of the Immigration and Nationality Act ( 8 U.S.C. 1229(a) ), the Secretary of Health and Human Services shall appoint or provide counsel to represent the child in removal proceedings under section 240 of the Immigration and Nationality Act ( 8 U.S.C. 1229a ), related matters before the Department of Homeland Security, and in any appeal proceeding before the Attorney General from any such removal proceeding. Counsel shall be provided under this subparagraph at Government expense unless a child has retained counsel authorized to represent the child in such proceedings. (ii) Immigration file Each unaccompanied alien child, and the counsel of such a child, shall receive a complete copy of the child's immigration file (other than documents protected from disclosure under section 552(b) of title 5, United States Code). (B) Role of the Department of Health and Human Services The Secretary of Health and Human Services shall— (i) to the maximum extent practicable, make every effort to use the services of competent counsel who agree to provide representation to children described in subparagraph (A)(i) without charge; (ii) in the case of an unaccompanied alien child who retained counsel at his or her own expense but whose counsel has ceased to represent the child, ensure the continued representation of the child through the pendency of removal proceedings and any appeal proceeding before the Attorney General from any such removal proceeding by appointing or providing new counsel as expeditiously as possible