This is worth a look
http://www.classictrucks.com/tech/0501cl_brake_line_basics/
Whichever section you decide to replace, make a plug, so the master cylinder doesn't run empty. It won't spray unless you push the brake pedal. But it will slowly drain, often until the master cylinder is empty. Search brake bleeding, ABS is a whole nother can of worms.
I've found vice lock pliers, adjusted so they are very firm but don't crush the fitting, about the surest way to remove a fitting, I wiggle the flare nut back and forth, until the bond breaks, then switch to a flare nut wrench. A good set of flare nut (or line wrenches) is a must, regular end wrenches won't get it. It is easy to round off the flare nuts. Sometimes you get lucky and can loosen the flare nut with a flare nut wrench, you have to know when to guit, so you don't damage the nut.
New flare nuts, don't have to be tightened that tight, the flare is actually the seal and overtightening can crush the flare and cause cracks.
Making a good double flare takes some practice. Make sure the flaring tool fits the brake line well. Sears brake line flaring tool is what I use, I have half a dozen different types to choose from in my shop.
Some of the brake lines in later model XJ's are millimeter, most are SAE. Not much difference in 5 mm and 3/16", a micrometer might come in handy. A good thread gauge might also be usefull, assuming can get you in trouble.