Hi Jimmy,
I suppose I should have been more clear about my expectations of count().
I've seen this post by Greg before, and use xdExtensions multiple places. They work in rules and filters, but if I try in an expression box I receive the error "Reference to undeclared namespace prefix: 'xdExtension'."
I was able to use NamedNodeProperty, as you suggested, to perform my calculations. It behaves similarly to an attribute, from what I can tell.
I set the value in code: XDocument.SetNamedNodeProperty(node, "show", "false" or "true")
Use it to filter: xdXDocument:GetNamedNodeProperty(., "show", "true") = "true"
And also to put the count in an expression box: count(../../my:Deficiencies/my:Deficiency[xdXDocument:GetNamedNodeProperty(., "show", "true") = "true"])
Once again, thank you very much for your help!