I have the following XML snippet:
Specification_Characteristics
One way is brute-force:
/root/CharacteristicUse/Value[ValueID='555']/preceding-sibling::* | /root/CharacteristicUse/Value[ValueID='555']/following-sibling::*
This includes the "UseArea" node also, not sure if you want that.
Or if what you want is just all the values that are NOT a particular value, then
/root/CharacteristicUse/Value[not(ValueID='555')]
is more direct.
I found the answer. The xpath looks like:
/root/CharacteristicUse/Value[ValueID='555']/following-sibling::Value | /root/CharacteristicUse/Value[ValueID='555']/preceding-sibling::Value