Access Nokogiri::XML::Attr's using #attr instead of through #attributes hash for more concise code and to gracefully handle missing attributes.