TikZ ER diagrams: really can't underline keys?

I'm creating an ER diagram with the TikZ ER library. The manual warns that although key attributes are conventionally underlined, it is hard to implement in TeX and the library uses italics instead. That's fine for me but my teachers probably won't accept the assignment with non-standard notations.

That's why I'm asking the TeX wizard community for a working solution :) Questions that may be relevant are:

MWE from the manual:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{er}

\begin{document}
\begin{tikzpicture}
\node[entity] (sheep) at (0,0) {Sheep}
child {node [key attribute] {name}};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
edge (sheep)
edge (genome);
\end{tikzpicture}
\end{document}

-
I wrote an article on the topic: the er library indeed does not provide automatically a tool to make key attributes underlined. You may want to \underline{attribute} or switch to tikz-er2 which provides a \key command. More information could be found in Drawing relationships between elements of a database. –  Claudio Fiandrino Sep 28 '13 at 13:17

Assuming I understand the requirements correctly, it is possible to 'capture' the node contents in a box using execute at begin node and execute at end node and do something afterwards with it. This only possible with 'simple' node contents (i.e., basically just text).

\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{er}
\newbox\underlinebox
\tikzset{
key attribute/.append style={
font=\rmfamily,
execute at begin node={%
\setbox\underlinebox=\hbox\bgroup
},
execute at end node={%
\egroup\underline{\box\underlinebox}%
}
}
}
\begin{document}
\begin{tikzpicture}
\node[entity] (sheep) at (0,0) {Sheep}
child {node [key attribute] {name}};
\node[entity] (genome) at (2,0) {Genome};
\node[relationship] at (1,1.5) {has}
edge (sheep)
edge (genome);
\end{tikzpicture}
\end{document}


-