public Element output(Document doc, int slot){
        TNode main = new TNode("item", getName(), doc);
        main.setAttribute("slot", String.valueOf(slot));
        if(getVisiblename() != null){
            main.setAttribute("name", getVisiblename());
        }
        if(getLore() != null){
            main.setAttribute("lore", getLore());
        }
        if(getAmount() > 1){
            main.setAttribute("amount", String.valueOf(getAmount()));
        }
        if (!enchantments.isEmpty()){
            String enchstr = "";
            for(int i = 0; i < enchantments.size() - 1; i++){
                //Build string first
                enchstr += enchantments.get(i).output() + ";";
            }
            //Add last enchantment with no semicolon
            enchstr += enchantments.get(enchantments.size() - 1).output();
            main.setAttribute("enchantment", enchstr);
        }
        
        return main.tag;
    }