Infosys interview question

They asked xpath and asked to write the java reverse program.