Optimized block-selecting code for selection based on element name.