xpath Finding elements containing specific attributes Find all elements with a certain attribute


Example

Imagine the following XML:

<root>
    <element foobar="hello_world" />
    <element example="this is one!" />
</root>
/root/element[@foobar]

and will return the <element foobar="hello_world" /> element.