If your UPS is connected to the Xserve via USB, just use the energy saver system preference tab to configure shutdown.
If your UPS is connected to the network with a management card, download this software:
and configure it. (that software is for 10.5 and 10.6, use version 2.2.4 for 10.4 servers). It's a little tedious to set up, but it works like a charm. Be sure to follow the instructions and have the network management card configured before attempting to set up the OS X software.
my specific parts:
APC Smart-UPS XL 3000VA
and the management card:
APC UPS Network Management Card 2
the pcconnection site has MFG part numbers and you can view aditional accesseries. I am not sure if I had to order a backplate or not.