code: public void setCredentials(Element el, String username, String password, Credentials c) {
  	if (c == null) return;
  	if (c.getUsername() != null) el.setAttribute(username, c.getUsername());
  	if (c.getPassword() != null) el.setAttribute(password, c.getPassword());
      }
docs: sets a Credentials to a XML Element
  
  @param el
  @param username
  @param password
  @param credentials