The pilot reported that during a cross-country flight at night, he was attempting to deviate due to deteriorating weather. During which, he failed to maintain terrain clearance and the airplane contacted the top of a tree. The pilot subsequently landed the airplane uneventfully at an airport about 23 miles away from where the tree contact was made. Examination of the airplane by a Federal Aviation Administration inspector revealed damage to the wings and windshield. The inspector did not observe any preimpact mechanical malfunctions, nor did the pilot report any.