Chemical milling of magnesium can be done using sulfuric acid. Process details are proprietary to companies that do chemical machining. You can find a little more information in the military standard MIL-C-81769, which is available by clicking on the following link:
I will have to find my old Dow reference on finishing (at home) to see if I can provide any additional details, but you can start by contacting some of these companies that perform chemical machining: