Like Viv says, the wind is moving the branches so they appear to dance. The writer is using a metaphor to create an image in our minds .... the wind blowing, with the branches seeming to 'dance' in choreographed response.
In conversation, you wouldn't say it (very often), but this style of writing is very, very common in novels or literature.