public String printXML(boolean XMLProject) {
        String XMLString = "";
        if (!printed) {
            XMLString += "<link.name>" + this.name + "</link.name>\r\n";
            XMLString += "<link.id>" + this.id + "</link.id>\r\n";
            if (p1 != null) {
                XMLString += "<from>\r\n";
                XMLString += this.p1.printXML(XMLProject);
                XMLString += "</from>\r\n";
            }
            if (p2 != null) {
                XMLString += "<to>\r\n";
                XMLString += this.p2.printXML(XMLProject);
                XMLString += "</to>\r\n";
            }
            XMLString += "<queue>\r\n";
            for (MediaItem item : this.mediaItems) {
                XMLString += item.printXML(XMLProject);
            }
            XMLString += "</queue>\r\n";
            if (this.links.size() > 0) {
                XMLString += "<links>\r\n";
                for (Link link : this.links) {
                    XMLString += "<link>\r\n";
                    XMLString += link.printXML(XMLProject);
                    XMLString += "</link>\r\n";
                }
                XMLString += "</links>\r\n";
            }
        } else {
            XMLString += "<link.shortcut>" + this.id + "</link.shortcut>\r\n";
        }
        this.printed = true;
        return XMLString;
    }