Prefer faster for loops in DomUtils.