§ 6701 Procedure.
(a) The legal title to lands or to any tenements whereon entry can be made may be tried in a civil action, based upon a cause of action in ejectment. The action shall be begun by filing in the office of the prothonotary of the county in which the lands or tenements lie a complaint setting forth the cause or causes of action of the plaintiff, a sufficient description of the lands and tenements claimed and such other facts as may be pertinent. If the premises for which the action is brought are actually occupied by any person such actual occupant shall be named defendant in the action, and all other persons claiming title or interest to or in the same may be joined as defendants. If the premises are not occupied the action shall be brought against some person exercising acts of ownership on the premises claimed or claiming title thereto or some interest therein at the commencement of the action. Upon the filing of such complaint a summons shall issue to the defendants named in the complaint and the same shall be served by the sheriff, together with a copy of the complaint, upon the defendant or defendants in the usual manner. The summons shall require the defendant therein to appear in the cause and to file an answer within 20 days after the service of the summons and complaint. The sheriff shall make return of his or her service as soon as the same can be done, irrespective of any term or terms of court.
(b) The answer or answers of the defendant or defendants shall set forth all of the defenses in law or fact and any defenses in law may be heard by the court at such time or in such manner as may be appropriate.