{ String name = helper.getQName(f); Object value = helper.getValue(o, f); if (value == null) { doc.startElement(name); doc.addAttribute(XSI_NIL, "true"); doc.endEmptyElement(); declareXSI = true; } else { EDataType d = (EDataType)f.getEType(); EPackage ePackage = d.getEPackage(); EFactory fac = ePackage.getEFactoryInstance(); doc.startElement(name); String svalue = helper.convertToString(fac, d, value); if (escape != null) { svalue = escape.convert(svalue); }  doc.endContentElement(svalue); }
{ saveElement(o, helper.getValue(o, f), f);
  protected void saveDataTypeElementSingle(EObject o, EStructuralFeature f)  {    String name = helper.getQName(f);    Object value = helper.getValue(o, f);    if (value == null)    {      doc.startElement(name);      doc.addAttribute(XSI_NIL, "true");      doc.endEmptyElement();      declareXSI = true;    }    else    {      EDataType d = (EDataType)f.getEType();      EPackage ePackage = d.getEPackage();      EFactory fac = ePackage.getEFactoryInstance();      doc.startElement(name);      String svalue = helper.convertToString(fac, d, value);      if (escape != null)      {        svalue = escape.convert(svalue);      }      doc.endContentElement(svalue);    }  }