Elsie L. Munsell, head of the civil division of the U.S. Attorney's office in Alexandria, is expected to become the first woman appointed as a U.S. magistrate in Virginia, sources said yesterday.

Munsell, 40, has been chosen for the $42,500-a-year magistrate's post by the federal judges in Virginia's Eastern Judicial District and is expected to be sworn in within the next few weeks, knowledgeable legal officials said.

Munsell confirmed that she is undergoing an FBI background investigation, a prerequisite for such an appointment, but she declined to comment on her prospective job.

The tentative selection of a woman for the newly created U.S. magistrate's position in Alexandria occurs at a time of considerable controversy centering on the absence of women and blacks from Virginia's federal bench. Several lawyers said that Munsell's prospective appointment will likely make her a strong contender for a judgeship in the future. "She's got a flying start," said a source familiar with the selection process.

Much of the recent controversy has stemmed from a dispute between President Carter and Sen. Harry F. Byrd Jr. (Ind.-Va.) over four new federal judgeships in Virginia. Byrd proposed 10 white male nominees, who had been recommended by special judicial selection commissions. Carter initially threatened to leave the judgeships vacant unless Byrd included women and blacks in his list. Later, Carter agreed to nominate two of the Byrd's candidates, but the other nominations are in doubt.

Munsell was among five candidates proposed for the U.S. magistrate's job in Alexandria by a seven-member court-appointed selection committee, according to sources.The names of the other four contenders have not been made public.

U.S. magistrates conduct preliminary hearings for persons charged with crimes, preside at trials in minor criminal cases and oversee some civil proceedings. Full-time magistrates are appointed for eight-year terms. There are currently two U.S. magistrates in Alexandria. A third magistrate's position-the one for which Munsell has been tentatively chosen-was established last year, according to court officials.

One woman, Jean F. Dwyer, serves as a U.S. magistrate in the District of Columbia. There are no female U.S. magistrates in Maryland, according to court officials. A small number of women serve as U.S. magistrates elsewhere in the country.

Munsell, who holds a law degree from the College of William and Mary, was the first woman appointed to the Alexandria commonwealth's attorney's office in 1972 and the first women to become an assistant U.S. attorney in Alexandria. She was appointed to that post in 1974. Her current salary is $34,000 a year.