Ideally, what I would like to be able to do is:
cat xhtmlfile.xhtml | getElementViaXPath --path=\'/html/head/title\' | sed -e \'s%(^|
Check out XML2 from http://www.ofb.net/~egnor/xml2/ which converts XML to a line-oriented format.