Fixed usage of getAttribute that now returns null
Lifted up xpath.js