private void renderElement(XmlElement element) {
		if (element instanceof XmlTextElement) {
			for (String text : element.getText().split(" ")) {
				elements.add(new TextInsert(text, formatStack));
			}
		} else if (element instanceof XmlTagElement) {
			XmlTagElement tag = (XmlTagElement)element;
			switch(tag.getLabel()) {
			case "img":
				elements.add(new ImageInsert(tag.getAttributes().get("src")));
				return;
			case "i":
				formatStack.push(new Formatting(FormattingType.ITALIC, tag.getAttributes()));
				break;
			case "b":
				formatStack.push(new Formatting(FormattingType.BOLD, tag.getAttributes()));
				break;
			case "span":
			default:
				formatStack.push(new Formatting(FormattingType.SPAN, tag.getAttributes()));
				break;
			}
			
			if (tag.getChildren() != null) {
				for(XmlElement child : tag.getChildren().getElements()) {
					renderElement(child);
				}
			}
			
			formatStack.pop();
		}
	}