I am receiving data from a server in the following format:
gin1601DepthOfBook<
I would suggest using XPath, which is an XML query language. If you have the Perl XML::XPath module installed then you could simply use the following command in your shell:
xpath -q -e '//sessionId/text()'