Section 10. The defendant in an action brought in Suffolk county by the city of Boston or by its collector may, if the action is brought in the supreme judicial or superior court, within thirty days after the day for appearance, file a motion in writing for the removal of the action to Essex, Middlesex or Norfolk county; and the court shall thereupon order it to be removed to the same court in such one of said counties as the attorney of the city of Boston elects.