This is the xml-data: \[code\]<DATA VERSION="1.0"> <TABLES> <ITEM> <identifyer V="1234"></identifyer> <property1 V="abcde"></property1> <Property2 V="qwerty"></property2> </ITEM> <ITEM> <identifyer V="5678"></identifyer> <Property1 V="zyxwv"></property1> <Property2 V="dvorak"></property2> </ITEM></TABLES>\[/code\]I am trying to find \[code\]property2\[/code\] of the item where \[code\]identifyer\[/code\] has value \[code\]1234\[/code\]. I can select the data: \[code\]$ xmlstarlet sel -t -c "/DATA/TABLES/ITEM/identifyer [@V=1234]" test.xml <identifyer V="1234"/>\[/code\]Two types of output would be desirable: \[code\]$ xmlstarlet <some magic><identifyer V="1234"></identifyer><property1 V="abcde"></property1><Property2 V="qwerty"></property2>\[/code\]And: \[code\]$ xmlstarlet <some magic>qwerty\[/code\]