Some hints with xmlstarlet and this file (file.xml):
<root>
<node user="user1">
<tag k="name" v="name1"/>
</node>
<node user="user2">
<tag k="network" v="nw1"/>
</node>
<node user="user3">
<tag k="foo" v="bar"/>
</node>
</root>
Get attributes:
xmlstarlet sel -t -v '//root/node/tag/@v' file.xml
Output:
name1
nw1
bar
Delete one node with attribute v="name1":
xmlstarlet ed -d '//root/node[tag[@v="name1"]]' file.xml
Output:
<?xml version="1.0"?>
<root>
<node user="user2">
<tag k="network" v="nw1"/>
</node>
<node user="user3">
<tag k="foo" v="bar"/>
</node>
</root>
Delete two nodes with attributes v="name1" or v="bar":
xmlstarlet ed -d '//root/node[tag[@v="name1"]]' -d '//root/node[tag[@v="bar"]]' file.xml
Output:
<?xml version="1.0"?>
<root>
<node user="user2">
<tag k="network" v="nw1"/>
</node>
</root>