public String toXml() {
		XmlCharacterEncoder xce = new XmlCharacterEncoder();
		String xml = "<heliostat";
		String uid = getUid();
		if (uid != null && !uid.trim().equals(""))
			xml += " uid=\"" + xce.encode(uid) + "\"";
		String label = getLabel();
		if (label != null && !label.trim().equals(""))
			xml += " label=\"" + xce.encode(label) + "\"";
		if (type != MIRROR)
			xml += " type=\"" + type + "\"";
		if (getShape() instanceof Rectangle2D.Float) {
			Rectangle2D.Float r = (Rectangle2D.Float) getShape();
			xml += " x=\"" + r.x + "\"";
			xml += " y=\"" + r.y + "\"";
			xml += " width=\"" + r.width + "\"";
			xml += " height=\"" + r.height + "\"";
		}
		if (target != null && target.getUid() != null && !target.getUid().trim().equals(""))
			xml += " target=\"" + target.getUid() + "\"";
		xml += "/>";
		return xml;
	}