code: public static Window showXML(Document document, BaseUIComponent parent) {
          Map<String, Object> args = Collections.singletonMap("document", document);
          boolean modal = parent == null;
          Window dialog = PopupDialog.show(XMLConstants.VIEW_DIALOG, args, modal, modal, modal, null);
          
          if (parent != null) {
              dialog.setParent(parent);
          }
          
          return dialog;
      }
docs: Show the dialog, loading the specified document.
  
  @param document The XML document.
  @param parent If specified, show viewer in embedded mode. Otherwise, show as modal dialog.
  @return The dialog.