I have this following xml fragment.
<root>
<site type="main">
<link>http://stackexchange.com</link>
</site>
<site type="qa">
<link>http://stackoverflow.com</link>
</site>
<site type="qa">
<link>http://superuser.com</link>
</site>
<site type="">
<link>http://data.stackexchange.com</link>
</site>
</root>
I want to select the first site's link of type "qa". I think //site[@type="qa"][1]
should do it. But id does not work.