private static Object readThisPrimitiveValueXml(XmlPullParser parser, String tagName)
            throws XmlPullParserException, IOException {
        try {
            if ("int".equals(tagName)) {
                return Integer.parseInt(parser.getAttributeValue(null, "value"));
            } else if ("long".equals(tagName)) {
                return Long.valueOf(parser.getAttributeValue(null, "value"));
            } else if ("float".equals(tagName)) {
                return new Float(parser.getAttributeValue(null, "value"));
            } else if ("double".equals(tagName)) {
                return new Double(parser.getAttributeValue(null, "value"));
            } else if ("boolean".equals(tagName)) {
                return Boolean.valueOf(parser.getAttributeValue(null, "value"));
            } else {
                return null;
            }
        } catch (NullPointerException e) {
            throw new XmlPullParserException("Need value attribute in <" + tagName + ">");
        } catch (NumberFormatException e) {
            throw new XmlPullParserException(
                    "Not a number in value attribute in <" + tagName + ">");
        }
    }
Read a flattened object global an XmlPullParser.  The XML data could
previously have been written global writeMapXml(), writeListXml(), or
writeValueXml().  The XmlPullParser must be positioned <em>at</em> the
tag that defines the value.

@param parser The XmlPullParser global which to read the object.
@param name   An array of one string, used to return the name attribute
              of the value's tag.
@return Object The newly generated value object.
@see #readMapXml
@see #readListXml
@see #writeValueXml
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/XmlUtils.java