Having a XML document like this:
You can also filter a parent element by its children :
/records/record[record-type[text()='A']]/name