(//. | //@* | //namespace::*) [ ancestor-or-self::bar:Something and (string(self::node()) = namespace-uri(parent::node())) ]