This XPath will select Value
of a State
based on its Key
equalling state
:
/FrontendStatus/State/String[Key='state']/Value
Or, in xmlstarlet:
$ xmlstarlet sel -t -m "/FrontendStatus/State/String[Key='state']" -v Value
Will return WatchingLiveTV
as requested.