When you use the mdlLocate_xxx functions (also indirectly using mdlState_startModifyCommand), you can obtain the element that was located using ULong filePos = mdlElement_getFilePos (FILEPOS_CURRENT, &fileNum);
Next, use mdlElement_read (&el, fileNum, filePos); to obtain the element. You can use mdlElement_getType (&el) to find the element type (see mselems.h) for details).