code: public void setFragments(List<XmlFragment> fragments) {
          assertNotNull(fragments);
          this.fragments.clear();
          for (XmlFragment fragment : fragments)
              addFragment(fragment);
      }
docs: Sets fragment list, removing any existing fragments first.
  Sets the parent pointer for each fragment in the list to this node.
  @param fragments fragment list.  Replaces any existing fragments.
  @throws IllegalArgumentException} if {@code fragments} is {@code null}