IMarkupFragment markup = container.getAssociatedMarkup();
IMarkupFragment childMarkup = null;
// MarkupStream is good at searching markup
MarkupStream stream = new MarkupStream(markup);
while (stream.skipUntil(ComponentTag.class) && (childMarkup == null))
{
ComponentTag tag = stream.getTag();
if (TagUtils.isWicketHeadTag(tag))
{
if (tag.getMarkupClass() == null)