Replaced all instances of $dom->attrs with $dom->attr