William A. Xanten, 74, who spent 40 years with the old D.C. Sanitation Department, the last 27 as its superintendent before retiring in 1963, died of cancer Wednesday in his home in Washington.

Probably the greatest challenge of his career was presented by the January 1961 blizzard which thretened to interrupt the inauguration of President John F. Kennedy.

As sanitation superintendent, it was Mr. Xanten's job to make sure that the city's streets were kept clear of snow. By the time the storm, dubbed "Nixon's Revenge," slowed to flurries the day before the inauguration, Mr. Xanten had his work cut out for him.

There were more than 1,500 stalled vehicles in the downtown area that had to be moved, 175 of them along Pennsylvania Avenue along. With less than 12 hours to go to the Jan. 20 inauguration, Washington sanitation vehicles, Army equipment and cranes from the Baltimore Harbor Tunnel towed the stranded vehicles into side streets, the Ellipse and the Mall.

With the aid of city employes, area college students, and about 500 Army troops with 200 pieces of equipment from Fort Belvoir, the parade route was cleared.

Along the East Front of the Capitol, where the inauguration took place, drifting snow was cleared by blowers and flame-throwers and red carpets were covered with burlap until the ceremony was about to begin.

Mr. Xanten was a native of Long Island, N.Y., and came to Washington in 1921. He joined the Sanitation Department two years later as a typist, was promoted through the ranks, and became its head in 1936. He earned a bachelor's degree in civil engineering at George Washington University.

In 1949 he was national president of the American Public Works Association. He also had belonged to the American societies of civil and mechanical engineers.

He served as a vice chairman of the D.C. Wage Board and as a member of the city's Urban Renewal Committee during his career with the city.

In 1951 he was given the American Public Works Congress's Charles Walter Nichols award for "outstanding work in developing refuse disposal facilities."

After retiring from government Mr. Xanten was a consulting engineer until the time of his death. Among his clients were the National Academy of Sciences and the United Nations' Pan American Health Organization.

His wife, the former Dorothy M. Herbsleb, died in 1976.

Survivors include two sons, William A. Jr. and David B., both of Washington, three daughters, Carol Herbert of Rockville, and Martha E. Xanten and Deborah Grippaudo, both of the Bahamas; a brother, Frank O., of North Carolina, and 13 granchildren.