Ping Arduino Led and Switch

I don't understand what you are doing on the second device. The first reads two ping sensors, poorly named, and sends the values and a bunch of other useless stuff to the serial port, where the XBee sends it over the air.

The second unit also appears to be reading a ping sensor. Then,

 if (distance < 10);

If the distance is less than 10, do nothing (;). Otherwise, do nothing (no else block). Why bother deciding whether to do nothing?

    else if (XbeeOutPin && (XbeeInPin,INPUT);//I can't get this 
                                             // line to work, needs some help?
    {
      
      digitalWrite (LedPin,HIGH);
    }

This else if statement makes no sense. What are XbeeOutPin and XBeeInPin for? If they are supposed to be SoftwareSerial port pins, then you are missing a lot of code to deal with a software serial port.

If they are for something else, what, exactly, are they for?

I'm nearly certain that (XbeeInPin, INPUT) is NOT doing what you think it is. But, since I can't tell what you think it is supposed to do, I can't be positive.

What, exactly, is supposed to make XbeeInPin HIGH or LOW? You've already declared that XbeeInPin is an INPUT pin. While there are ways to detect the direction of a pin, the easiest is for you to simply remember which direction you defined for the pin.

Instead of talking about what you think you need to do, perhaps what you need to describe is why each Arduino has a ping sensor, what each is supposed to collect data from, and what each is supposed to send data to the other for.

I am trying to save on the battery power, So I think line passing with xbee's is the best.

Saving battery power while using XBees hardly seems reasonable. Nothing in the code on either Arduino is putting the XBees to sleep or waking them up. What "line passing" means or how it relates to power savings is not at all clear.

It needs help with code, because I don't know how to get line (else if (XbeeOutPin && (XbeeInPin,INPUT);//I can't get this line to work, needs some help?)

Instead of talking about the code that you think might possibly do what you want, talk about what you want the code to do. We'll tell you what code to then use.