The Nielsen Method For Groups Acting on Trees