Just to add some precisions.
If you want to check if the property exists even though it's empty you should definitely use hasOwnProperty :
var propertyExists:Boolean = node.hasOwnProperty('@hasCover');
Checking the length of the content is somehow dirty and will return false if the value of the attribute is empty. You may even have a run-time error thrown as you will try to access a property(length) on a null object (hasCover) in case the attribute doesn't exist.
If you want to test if the property exists and the value is set you should try both starting with the hasOwnProperty so that the value test (eventual run-time error) gets ignored in case the attribute doesn't exist :
var propertyExistsAndContainsValue:Boolean = (node.hasOwnProperty('@hasCover') && [email protected]());