I have to find all items in Sitecore (or rather, in the contents) that have a certain OMS (marketing suite) profile checked in the \"Tracking\" attribute. The Tracking attribute
Ugh, the Tracking field is actually stored as __Tracking. Whoops. So the query ends up being
fast://*[@__Tracking = '%"Widdly Scuds"%']
This still has problems, as it's still trying to query XML via string operations and I may end up screwed later if a profile and key have the same name, but it works well enough for now.
If you use query or iterate descendants, avoid starting the query from / if possible - start from the equivalent of /sitecore/content/someitem.
Another approach is to use a Lucene or other search index. See the Sitecore reference for more info.