I figured it out. Thanks for your comments.
Why do you have _ID attributes and why can't you use an association?
Everything tells me that you are not using the strength of mendix in the right way.
Answering your question;
You can't retrieve attributes, you always will retrieve whole records/objects of an entity. Which results in a $Variable containing the object.
Retrieve of a (set of) objects constraint by a XPath like this; [Attribute = value]
Where attribute is part of your queried entity and value is either a hardcoded value', a singulair $Variable or a object variable $ObjectVariable/value