public static Xpp3Dom build(Reader reader, boolean trim)
      throws XmlPullParserException, IOException {
    XmlPullParser parser = new MXParser();

    parser.setInput(reader);

    try {
      return build(parser, trim);
    } finally {
      IOUtil.close(reader);
    }
  }
  public static Xpp3Dom build(InputStream is, String encoding, boolean trim)
      throws XmlPullParserException, IOException {
    XmlPullParser parser = new MXParser();

    parser.setInput(is, encoding);

    try {
      return build(parser, trim);
    } finally {
      IOUtil.close(is);
    }
  }