StringBuffer htmlString = new StringBuffer();
Hashtable attrs = tag.getAttributes();
String pTagName = tag.getAttribute(Tag.TAGNAME);
htmlString.append("<").append(pTagName);
for (Enumeration e = attrs.keys(); e.hasMoreElements();)
{
String key = (String) e.nextElement();
String value = (String) attrs.get(key);
if (!key.equalsIgnoreCase(Tag.TAGNAME) && value.length() > 0)
htmlString.append(" ").append(key).append("=\"").append(