Fixed XML bug (thanks StackOverflow)