Added method for getting element pointer.

This should be slightly more efficient than first checking if an
attribute exists and then getting it.