Hold the chord and pick through the notes. You will create a melody on the E String while holding the D Chord. This technique is used in many songs so it's important that you get it down. Make sure the notes ring out.
A similar melody is played in the song Summer Of '69 by Bryan Adams. This is a great repeating progression that will train your fingers.