XML finally working (but some little bugs)