I have both DA 35mm f2.4 and DA 40mm XS. They are different, though it would be hard to say which is "better." My opinions: Wide open, the DA 35mm is better (less fringing). Bokeh, the 40mm XS is better. 40mm renders more detail, as it is a telephoto. DA 35mm is at around the same sharpness, but it is a wider angle, so it doesn't "appear" as sharp (a telephoto lens seems sharper, because it shows a lot of detail that we don't see with the naked eye, while a wider angle captures more of the frame, so detail is minimized and even lost, thus "appearing" less sharp, because sharpness is not just about resolution). DA 35mm has some distortion and is not great for face portraits. Flare and fringing resistance, DA 35mm is better.
Which lens do I like more? I usually prefer the DA 35mm for wider angle and for natural scenes; while I prefer the DA 40mm XS for man-made objects, artificial things, and flowers that are very saturated, colourful. DA 40mm XS can be used for some portraits, but it can be unflatteringly sharp.
Another thing to consider is the DA 40mm XS has a very odd filter thread size (27mm), which means you can only use camcorder filters and will have a hard time finding a lens hood. One more lens is the
FA 35mm f2.0, still in stock as new, which has a more robust build, an aperture ring, and comes with a lens hood. Some say the FA 35mm is slightly better than the DA 35mm, others say its essentially the same lens. Over here in Europe, the FA 35mm is much more expensive than the DA 35mm, so its not as beloved