TokenHierarchy th = TokenHierarchy.get(document);
TokenSequence ts = th.tokenSequence();
while (ts.moveNext()) {
Token nextToken = ts.token();
if (nextToken.id() == XMLTokenId.TAG) {
String tagName = nextToken.text().toString();
if (tagName.startsWith("<")) {
return tagName.substring(1, tagName.length());
}
}
}