Just a note: defining the _XTAL_FREQ symbol does nothing unless you also use the various _delay macros. It does not in any way set the oscillator configuration.
To check whether the oscillator is working you could use a scope (assuming it has a high enough impedance).
However, if you are using MPLAB, then use the debug mode and single step your way through the code. If the oscillator is not working then the device will not respond to the debugger; if it is then you will be able to step your way through the program.
You might be getting caught by the RMW problem that can occur in devices that don't have the 'LAT' registers (as the later Microchip devices do). Try setting the whole of the PORTD register at once (and it does not need to be within the main loop) rather than various bits at a time. Also try setting more pins to '1' - the the moment you are only setting PORTD bit 3 to logical 1 (whereas the beginning of your post uses "pins" plural).
Susan