Yes, I mostly agree with Martin. I've been in early design meetings where we wanted to provide a direct line cord, but that eventually got shot down due to the hassle and expense of getting regulatory approval. We know that consumers don't like wall warts, but unfortunately the compliance issues in getting a product to market force this tradeoff.
It's actually not a legal requirement. There are surprisingly few of those, at least here in the US. However, in reality you can't have a consumer product that uses wall power in some form without UL or equivalent certification. You can follow all the best design rules and know your product is at least as safe as others with approval, but nobody wants to gamble on the liability of not having their butt covered by UL. Major retailers, for example, wouldn't touch it without formal approval.
If your product sells in the millions, sooner or later someone is going to do something stupid and get zapped. It may even be deliberate fraud just to try to extract a settlement, but that matters little. It helps tremendously in the legal process to say that your product followed "accepted safety practises" and was certified to that effect by UL or equivalent.
If you use a external approved power supply so that low voltage only goes to your unit, you are pretty much off the hook safety-wise. The external power supply provides the isolation, and as long as voltages in your unit are 48V or less and limited to a particular current (I forget the limit), you're basically fine.
For moderate product drawing 10s of Watts or more, it's usually worth it to put the line cord on it directly. Plenty of manufacturers make pre-certified power bricks you can embed into the product. You still will want certification for the whole product, but that's a lot easier and cheaper if you are using a power brick that has already been certified. In that case they usually just look for overall insulation and spacing, that the proper fuse is before the power brick, the mechanics of how the power enters the unit, etc.
If the product is intended for international distribution (and more are these days), you put a standard line cord socket on the product, then provide localized line cords. Power bricks that work over the worldwide range of roughly 90-240 VAC 50/60 Hz are pretty common these days. After a few 10s of Watts, most will have power factor control too.
I would not perform surgury on line cords to install switches. I'd look at solving the more general problem of switched power at your desk. This probably won't be up to code, so don't let anyone official see this, and hiding it a bit is probably a good idea. You can mount a regular wall switch somewhere on the side of your desk in a metal electrical box. Get a line cord with wire ends or cut the female end off a extension cord and have that go into your switch. Coming out of that you have switched power which can go to a bunch of regular wall outlets mounted in more metal electrical boxes under or at the back of your desk. Now you can plug in whatever you want switched to these outlets without having to modify the equipment at all. When you upgrade equipment, just plug in the new stuff without having to modify it.
Having general switchable outlets attached to you desk could be useful for various things. Here in the office I have several switched outlet strips stuck to backsides and undersides of various desks. They come in quite handy. There are a lot of things you need to plug in when you work with electronics and computers.
Added:
As Photon pointed out, I should have mentioned that all these electric boxes should be grounded. That's why I said to make them metal. I meant to say to ground them but somehow forgot.
There will be three wires that come from the line cord that goes into the first box with the switch: Hot, neutral, and ground. Here in the US these are usually color coded black, white, and green, respectively, but don't rely on that. The neutrals of everything coming into and going out of a box should simply be connected. The ground should also be connected, but also to the box. There is usually a separate screw inside the box just for clamping a ground wire to it. The hot line is what gets switched in the first box. What comes out of that box therefore is the same neutral and ground that went in, but the hot is either connected or floating depending on whether the switch is on or off.
If you are paranoid or want to go further, you can use a DPST switch to switch both hot and neutral. Never switch ground. That must always be reliably connected straight thru and to every metal box.
If you're really paranoid, you can install a ground fault interruptor in the first box immediately to the incoming power. That shuts off the power if it sees a imballance between the hot and neutral currents. When all is working right, all the current that flows out on the hot line should come back on the neutral line. If something goes wrong, like your body is conduting between hot and a metal radiator pipe for example, then the hot and neutral currents won't ballance anymore and it shuts off power before you get too fried, hopefully, if all works right.
Best Answer
To establish the ELV you will need isolation. This will probably be a transformer (Linear or Switchmode does not matter)
Transformers can be protected in a number of ways from faults...
Over voltage sensing can be via opto-isolators with zeners or similar .
In the end testing will probably be required unless you buy a pre-evaluated product.
This depends on your end application. There will be a safety aspects in those standards that relate to transformers and their faults. Look at what the requirements are and this determines your minimum effort/cost. Get your self access to those standards and read them.
The best way is to be taught by one of the more experienced engineers. Ask them to review a design with you. Trying to read standards the first time tends to drive you crazy with forward and backward references ... oh and the language used between Europe and the US can also make life interesting.