220v to 9 v transformerless power supply
You are missing the circuit in your question. Anyhow...

Anything which safely isolates your AC supply from your output supply - such as using a transformer with full bridge rectifier and a regulator, should work to keep you safe, should you touch the 9V DC (i.e. none of the AC will get to you from there). A transformer is commonly used as its a good way to reduce voltage (and get more current for the same power, obviously) all in one step (as opposed to multiple voltage drops from a rectified 220V source, for example) - so the regulation doesnt require high power components. Its easier to regulate 9 or 6 volts from a 12 or 24 Vrms AC supply than it would be from a 220Vrms supply (where RMS is the "average" value of the AC sinusoid - what you commonly hear as the voltage of the signal, ie, 220V).

There aren't many other ways that can still be safe, because if you think of the transformer as a layer of abstraction from your supply (that is, 220V into it and, say, 24V AC out) and assuming of course your transformer is very well physically secured with no stray wires, then really you are only likely to touch the 24V AC signal unless you poke around inside it deliberately. Along with this, its easier to turn 24V AC to 9V DC as the components don't need to undergo such a huge voltage drop. Of course, switch mode transformers may also work but there is potential for malfunction and this could compromise the isolation of the circuit if its cheaply or improperly built.

I recommend you purchase a ready made transformer and incorporate it into your house, so its essentially plug and play. I've seen houses where they use 12V LED spotlights and have a transformer like this one above them hidden in the brickwork. Yes, thats for lights, but it works the same way as for any other device.