I also have a 2002 XR400 and struggled constantly with starting it and keeping it running.
This is what I did thanks to some great people on this board and others.
Switch the main jet to a 160
Switch the pilot to a 60
Remove the airbox lid
Remove the header pipe and look at where the flange that they weld onto the header pipe so that it may be bolted to the head. The weld bead is so large that is restricts the diameter to half size. Grind that down a bit. Not too much. I think I used a socket but I can't remember exactly which size but if you email me I can give you some other ideas.
I also modified the cap on the muffler also.
With this setup now, I follow the following routine.
When it hasn't started for a while
I put the chock on full, Turn up the idle screw know about a full turn, pull in the compression release, Thumb on the kill button, throttle wide open, kick the engine over 3 to 4 times.
Then let go of everything but leave the choke on.
Find TDC, bump it just past with the compression release and boot it. Starts usually first boot everytime, even when it has sat for months (it's so dusty that we haven't been riding).
Experimant with the choke as it's warming up. Once warm, turn down the idle and enjoy a ton more power and much easier starting.
When warm, and you kill it, just boot it, works slick as a whistle.
Let me know if what I said didn't make sense...FYI, 160-60 works great for sea level to about 2500 feet