EDataType d = (EDataType)f.getEType(); EPackage ePackage = d.getEPackage(); EFactory fac = ePackage.getEFactoryInstance(); Object value = helper.getValue(o, f); if (value != null)
String svalue = getDatatypeValue(helper.getValue(o, f), f); if (svalue != null)
  protected void saveDataTypeSingle(EObject o, EStructuralFeature f)  {    EDataType d = (EDataType)f.getEType();    EPackage ePackage = d.getEPackage();    EFactory fac = ePackage.getEFactoryInstance();    Object value = helper.getValue(o, f);    if (value != null)    {      String svalue = helper.convertToString(fac, d, value);      if (escape != null)      {        svalue = escape.convert(svalue);      }      doc.addAttribute(helper.getQName(f), svalue);    }  }