B ; All <B> elements
LI,B ; All <B> elements inside <LI>
LI,B=4 ; All <B> elements that are the 4th <B> to occur
within an <LI>
LI=2,B=1 ; The first <B> inside the second <LI> in the
document
Then add attribute-based derivation:
#CLASS="foo ; all elements of class "foo"
LI#CLASS="foo",B#CLASS="bar" ; All <B> elements that are of class
"bar" that occur within <LI> of
class "foo"
Where CLASS could be replaced with an attribute.