changed hasChildNodes and hasAttributes to methods in class Node