First thing is get familiar with the EGR system for the Altima to know which pipes and passages connect where (credit for this goes to Nissan):
Something to note is the "collector" does not show the intake manifold, the flat/2d nature of the image doesn't reflect that the intake manifold has a EGR passage to each cylinder.
Based on that diagram there are six main things you should test:
1. The EGRC Solenoid valve. This can easily be tested using the service manual (again find this online). You pull this off the car, apply 12v to the terminals and listen for a click and also test the vacuum passage ways for continuity. There are three vacuum line hook ups on this valve that Nissan labels A, B and C and Nissan gives you a table of which passages should connect to which when the solenoid is open or closed. You can get 12v from your car, small vehicle/engine battery or even your Verizon FIOS ONT box has one, or you can just chain a bunch of 1.5v or 3v batteries in sequence to make a 12v battery).
2. The EGR valve itself. Vacuum test is easy, pull diaphragm up, plug the hole with your finger and see if diaphragm holds vacuum (or use a vacuum pump like I did). You should pull it just to make sure it's clean, clean it and inspect.
3. The EGRC-BPT valve. This is the flat/pan shaped UFO thing to the side of the EGR valve. For this one, pull it off car, blow through hose on bottom of valve, blow into it while pulling a vacuum on one of the top two hoses (plug the second hose with your hand). It should only pull a vacuum when you're blowing and release vacuum when you stop blowing. When the car is running, the exhaust gases flow through and do the same thing instead of you blowing on it.
4. The EGRC-BPT valve pipe. The hose that goes under the EGRC-BPT valve (the one you blew through) connects to a special metal exhaust pipe that is larger in diameter than rest of vacuum gallery pipes. This pipe is flared and uses a pipe fitting similar to a brake line. This pipe is wide but the actual ends have pin holes to increase pressure I assume. While not related to P0400, you should remove this and clean it up. You'll need to get a combination wrench on this and undo the fitting. When the fitting is fully unthreaded you'll need to pull toward you to pop it out, it's usually got a little rust holding it in so wiggle it. I had to remove a few bolts and nuts holding the vacuum gallery on to the intake manifold to be able to pull the vacuum gallery a little toward me to give me clearance here. Once the pipe is off, run some brake cleaner through it and a paper clip through the whole thing from both ends. You should see a lot of black liquid come out. Blow through it when done to confirm it has continuity.
5. The EGR temperature sensor. This is on the same "base" under the EGR valve. When you take this off it should be caked in carbon, clean it off and test resistance with multimeter according to service manual with a piece of ice for cold temp.
6. Vacuum lines. Check every single vacuum line that runs from the vacuum gallery to various things. These go to the fuel pressure regulator, intake manifold, air duct, the EGRC solenoid valve, EGR valve, EGRC-BPT valve. I'd just recommend replacing all of them if they're crusty and falling apart.
7. The EGR ports inside the intake manifold. If you stand on the passenger side and look at that side of the intake manifold, you should see a circle plug with a hex/allen socket. That's a 10mm hex, that plug is threaded and comes out. What I did was take that out and all of the EGR stuff off and shot a bunch of brake cleaner inside and from the top where the EGR valve mounts. A ton of black liquid ran out. Wouldn't hurt to bore brush the inside of that passage too. Be aware that you'll have to air everything out real good and there's a real possibility the cleaner might prevent the car from starting and some cleaner might end up in the cylinders and foul the spark plugs. When I did this I ran into an inability to start, fouled spark plugs, a whole mess. But I over did it on the brake cleaner and maybe should have used throttle body cleaner instead. I left everything off and left it over night, shot some compressed air through the system to air it all out and got the car working and haven't had a problem since. The first time I got the car started the fuel trims were unusually high, I just assumed that was cleaner fumes being used as fuel.
Maybe take it easier than I did, bore brush it dry first, shoot some compressed air from the EGR valve side to blow the dust out that circle plug hole, then some throttle body cleaner spraying from above and blow it out from the same side with compressed air.
Doing this cleaning fixed the misfires for good so it was worth it for me (it's been a month now, misfires never came back and it made a huge difference in how the car feels).
Some miscellaneous things:
1. This should be common sense but when you take all of the EGR stuff off, stick a coat hanger or something through the passages to make sure things connect. For example the hole the EGR temp sensor goes into should connect to the main EGR passage under the EGR valve.
2. One of the vacuum lines I would not recommend replacing is the one that goes deep down into the intake manifold. You'll know when you see it, if you try to replace this, mess it up, you probably won't be able to get your hose and fingers deep enough to put this one back on. Don't bother with it.
3. People commonly run into the hose under the EGRC-BPT valve having a hole in it. I didn't.
4. There were a lot of places where I had to use a propane torch or I would have stripped them (MAP/PRO in my case but I turned down heat so much you can just use a $25.00 propane torch). The two nuts that hold the EGR valve for example I started to round until I put heat on it, I even put a small amount of heat on the temp sensor and the EGRC-BPT valve pipe fitting. I also heated the hex plug for the EGR port on the manifold. That one I couldn't remove with a breaker bar until I heated it. I've stripped those hex plugs on Nissan's before. Be careful, don't burn any of the hoses or anything around it like harnesses (DOUBLE CHECK FOR THIS STUFF BEFORE HEATING). There's obviously a fuel rail right near this stuff too! Maybe if you're in Utah you won't have to torch it like I had to ([censored] rust).
Here's Nissan's official diagnosis chart for P0400:
Here are two of my pictures when I was doing this:
From top to bottom that's EGR valve, EGRC-BPT valve pipe (note the flared line and fitting), EGR temp sensor, EGRC-BPT valve (the hole facing the camera is the one you blow through with hose connected to that hole).
This is a wide shot of the EGR stuff. The orange if EGRC solenoid valve (under this on the side of the manifold is the circle plug). The blue line is the vacuum gallery under the black fuel rail wire harness. The larger red circle is the EGR valve holes, the two small ones from top to bottom are EGR temp sensor and EGRC-BPT valve pipe respectively.