@Override
    public String toString()
    {
        String ret = null;
        switch (type)
        {
            case ELEMENT:
                ret = "<" + getTagName();
                if (getAttribute("id") != null)
                    ret += " id=" + getAttribute("id");
                if (getAttribute("class") != null)
                    ret += " class=" + getAttribute("class");
                ret += ">";
                break;
            case REPLACED_CONTENT:
                ret = "[replaced content]";
                break;
            case TEXT_CONTENT:
                ret = "Text: " + getText();
                break;
        }
        return ret;
    }