updated xpath tool to output to text file, works on multi-levelled directory structure