code: public void copyFrom(XElement other) {
          content = other.content;
          userObject = other.userObject;
          attributes.putAll(other.attributes);
          for (XElement c : other.children) {
              add(c.copy());
          }
      }
docs: Copy the attributes, content and child elements from the other element
  in a deep-copy fashion.
  @param other the other element