Depending on what you want to include/exclude, your Xpath constraint should look like this:
[Module.Entity.Attribute = $Attribute]
Where $Attribute is the attribute of the current object (Module/Entity).
I hope you can use this to create your constraint.