In code practice. Whenever the defendant seeks affirmative relief against any party, relating to or depending upon the contract or transaction upon which the action is brought, or affecting the property to which the action relates, he may, in addition to his answer, file at the same time, or by permission of the court subsequently, a cross-complaint. The cross-complaint must be served upon the parties affected thereby, and such parties may demur or answer thereto as to the original complaint. Code Civ. Proc. Cal.