/** Used for some backward compatibility hacks. */
 MixedContent asMixedContent() {
   MixedContent mixedContent = new MixedContent();
   if (count != 0) {
     TemplateElement first = buffer[0];
     mixedContent.setChildren(this);
     mixedContent.setLocation(first.getTemplate(), first, getLast());
   }
   return mixedContent;
 }
 /** Used for some backward compatibility hacks. */
 TemplateElement asSingleElement() {
   if (count == 0) {
     return new TextBlock(CollectionUtils.EMPTY_CHAR_ARRAY, false);
   } else {
     TemplateElement first = buffer[0];
     if (count == 1) {
       return first;
     } else {
       MixedContent mixedContent = new MixedContent();
       mixedContent.setChildren(this);
       mixedContent.setLocation(first.getTemplate(), first, getLast());
       return mixedContent;
     }
   }
 }