code: public static Layout parseStream(InputStream stream) {
          try (InputStream is = stream) {
              return parseDocument(XMLUtil.parseXMLFromStream(is));
          } catch (Exception e) {
              throw MiscUtil.toUnchecked(e);
          }
      }
docs: Parse layout from an input stream.
  
  @param stream The input stream.
  @return The root layout element.