Changed string parsing to xpath parsing