v1 working version with xml