Path Queries in Weighted Trees