Added better XML node checking