Xylophagidae
 

Xylophagidae are long, slender flies with long antennae. They are often encountered on the bark of trees. They look somewhat like parasitic wasps (Ichneumonidae and allies) and can be confused with them in the field. The key is based on Van der Goot (1995).

Xylophagus ater on diptera.info.

1a First antennal segment cylindrical, about 4 times longer than the 2nd segment. Female: tergites black ->, 2

1b First antennal segment oval, about two times longer than the 2nd segment. Female: tergite 2-4 reddish ->, 3

2a Male: thoracic dorsum shining black with few traces of dust. Female: thoracic dorsum with 3 lines of white dust. 8-15 mm ->, Xylophagus compeditus

2b Thoracic dorsum whitish dusted with black shining side borders for both male and female. 11-16 mm. ->, Xylophagus ater

3a Thoracic dorsum whitish dusted with black shining side borders; tergite 1 dusted ->, Xylophagus cinctus

3b Thoracic dorsum shing black; tergite 1 shining black. 10-20 mm ->, Xylophagus junki