Inverted hasChildNodes() logic to ensure that the existance of a firstChild means there are childNodes. Added test to verify hasChildNodes() change with formatting per guidelines.