attrs.item(i).normalize();
DomNode attr = (DomNode) attrs.item(i); boolean saved3 = attr.readonly; attr.readonly = false; attr.normalize(); attr.readonly = saved3;
  public final void normalize()  {    // Suspend readonly status    boolean saved = readonly;    readonly = false;    for (DomNode ctx = first; ctx != null; ctx = ctx.next)      {        switch (ctx.nodeType)          {          case TEXT_NODE:            while (ctx.next != null && ctx.next.nodeType == TEXT_NODE)              {                Text text = (Text) ctx;                text.appendData(ctx.next.getNodeValue());                removeChild(ctx.next);              }            break;          case ELEMENT_NODE:            NamedNodeMap attrs = ctx.getAttributes();            int len = attrs.getLength();            for (int i = 0; i < len; i++)              {                attrs.item(i).normalize();              }            // Fall through          case DOCUMENT_NODE:          case DOCUMENT_FRAGMENT_NODE:          case ATTRIBUTE_NODE:          case ENTITY_REFERENCE_NODE:            ctx.normalize();            break;          }      }    readonly = saved;  }