Change metadata xml parsing, adapt test