At the risk of being blunt, your code (at least as posted) cannot possibly be correctly identifying widgets with the work "type" in the widgetName element, because you're checking the age element (converted to a string).
Other than that, because you're checking each element with the correct name (or will be, once you fix that bug), and then keeping track of the maximum age value, and the vector-index of the corresponding element, you -are- in effect "storing that widget's info for comparison". The element is already stored in the vector, and the index allows you to get back to it at any point. If you wish, you can more explicitly copy the Element of interest into a separate variable, and perform your comparisons against that, including when to replace it with a new Element, but remember to keep track of the case where you haven't yet found any valid element, and at the end of you loop, check whether any elements with "type" in the widgetName were found.
Which reminds me, if you keep the code more or less as-is, be sure to initialize both highest_age and highest_age_index to sensible values (maybe -1 for both). Especially for the index (currently default-initialized to zero), if you go through all the widgets in your vector and don't find any with "type" in the widgetName, at the end of the loop, you'll incorrectly believe that element zero had the maximum age (of zero), even though it was never considered as a …