xmlstarlet sel -I -t \ -m '/updates/update' \ -i 'pkglist/collection/package[@name="raydium"]' \ -c . \ /var/cache/yum/x86_64/15/updates/gen/updateinfo.xml
...I'll explain each line of the above:
- {xmlstarlet sel -I -t} -- Runs the command, in "select" mode and does automatic indentation of the output.
- {-m '/updates/update'} -- Where we are matching "from", comparing this to grep we are kind of saying that each node at <updates><update> is a line. This is an XPATH expression.
- {-i 'pkglist/collection/package[@name="raydi
um"]'} -- The condition we want to match on, here we are saying that we want to match on anything of the form <updates><update><pkglist><collection><p ackage name="raydium">. This is an XPATH expression (it's worth repeating the @ changes the match from the node to the attribute). - {-c .} -- This says display all the nodes from the start of our match #2, that pass our condition.
- { /var/cache/yum/x86_64/15/updates/gen/upd
ateinfo.xml } -- The XML file to operate on (if it's missing it default to stdin.