I thought about doing that, but these namespaces are hard-coded into the configuration: the only way .head throws a NoSuchElementException is if the configuration has been messed up, in which case execution *should* stop until someone fixes it. If I'm reading your code correctly, it would keep running in that case, which means that somebody processing Commons records with a broken configuration will get by incorrect results. To put it another way, I don't think there isn't any value in catching that Exception at this point, except maybe to re-throw it as a more sensible exception (changing a NoSuchElementException to a RuntimeException("Commons-specific namespaces have not been defined", say).