Suppose you want to search the rpm's installed on a linux server that uses rpm (the Redhat Package Manager). I find the easiest way to query is by doing something like this:
rpm -qa | fgrep httpd
The -qa will list all installed rpm's, then we can pipe a grep to search the list.
XML