check to make sure we have an XML element before asking for its attribute nodes