The first task is to build the cells. If E is a cell of X, and F is a cell of Y, EF becomes a cell in XY. These cover all the points of XY, and they are disjoint, hence they partition XY. Also, each EF is open in XY, since E is open in X and F is open in Y.
Let g map Dm onto the closure of E, and let h map Dn onto the closure of F. These are the characteristic functions for the two cells. Let W be Dm cross Dn. build a composite function j from W into XY that follows g for the first component and h for the second. Verify that the preimage of a base open set in XY is a base open set in W, so there is no trouble with continuity.
The interior of W is the direct product of the interior of the two balls, and j maps this homeomorphically to the open cell EF. Take this away, and j maps the boundary to the boundary of E cross F union the boundary of F cross E. This is covered by finitely many cells of dimension less than m+n.
Next, we need to show that the domain W is essentially a ball. In other words, the product of two closed balls is homeomorphic to a ball. I'll illustrate with dimensions 1 and 2. Cross a closed interval with a closed disk and get a cylinder in three dimensions. Place a three dimensional ball inside this cylinder and push the ball outward, linearly, until its surface becomes the surface of the cylinder. More than just a homeomorphism, this is a homotopy. In any case, the two spaces are equivalent, and the interior maps to the interior, and the boundary maps to the boundary. This can be generalized to m and n dimensions. Basically, you are pushing one convex shape, i.E. Dm+n, outward to fill another comvex shape, i.E. Dm cross Dn. If you like trigonometry in higher dimensions, you can even derive the mathematical formula. I'll leave the details to you.
Now for the topology. Let T be a subspace of XY that is not closed, yet the intersection with each closed cell is closed. Let p be a limit point of T that is not contained in T. Let p have the coordinates a and b, from X cross Y. Choose open sets in X and Y, containing a and b respectively, such that their closures are compact. Remember that these closures are covered by finitely many cells in X and Y. The product of our open sets becomes an open set Q in XY, containing p, that is covered by finitely many cells in the product space.
Let EF be the closure of one of these cells. In other words, EF is a "closed cell" in XY. Suppose p can be isolated (in an open set) away from T intersect EF. Further suppose this can be done for each EF touching Q. Take the intersection, and p is in an open set apart from T. This is a contradiction, hence there is a closed cell EF such that p is a limit point of EF∩T. Yet the intersection of T with EF is closed in EF, hence p belongs to the intersection, and p belongs to T. Thus T is closed after all. The topology is valid, and the direct product XY is a cw complex.
Select a point p, with coordinates a and b. Choose open sets about a and b, whose closures (C and D) are compact. Let Q be the product of these open sets, which is open in XY, and contains p. The closure of Q is closed, and lives in the product CD. The complement of CD is the union of two open sets, and is open, hence CD is closed. By the Tikhonov product theorem, CD is compact. A closed subset of a compact space is compact. Therefore the closure of Q is compact, and XY is locally compact.
This generalizes to the n dimensional torus, which has a natural representation as a cw complex with 2n cells.