public void insertText(XmlMarshallingContext ctx, String fieldText) {
        if (fieldText == null && isLazy()) {
            return;
        }
        if (fieldText == Value.NIL) {
            fieldText = null;
        }
        
        Document document = ctx.getDocument();
        
        Element element = document.createElementNS(getNamespace(), getLocalName());
        if (!isNamespaceAware()) {
            element.setUserData(XmlWriter.IS_NAMESPACE_IGNORED, Boolean.TRUE, null);
        }
        else {
            if ("".equals(getPrefix())) {
                element.setUserData(XmlWriter.IS_DEFAULT_NAMESPACE, Boolean.TRUE, null);
            }
            else {
                element.setPrefix(getPrefix());
            }
        }
        
        if (fieldText == null && isNillable()) {
            element.setAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "nil", "true");
        }
        else if (fieldText != null && fieldText.length() > 0) {
            element.appendChild(document.createTextNode(fieldText));
        }
        
        Element parent = (Element) ctx.getParent();
        parent.appendChild(element);
    }