convert java and xml to scala