Possible NPE in getNextSiblingIgnoringWhitespace fixed. Some warnings also removed. Last comma is replaced by semicolon. Comments are taken into account.