code: private LayoutRoot parseUI(ElementBase root) {
          LayoutRoot ele = new LayoutRoot();
  
          if (root instanceof ElementDesktop) {
              copyAttributes(root, ele);
          }
  
          parseChildren(root, ele);
          return ele;
      }
docs: Parse the layout from the UI element tree.
  
  @param root The root of the UI element tree.
  @return The root layout element.