On XmlPullParser api, the getText() method has the following description:
Returns the text content of the current event as String. The value returned depends on current event type, for example for TEXT event it is element content (this is typical case when next() is used). See description of nextToken() for detailed description of
possible returned values for different types of events.NOTE: in case of ENTITY_REF, this method returns the entity replacement text (or null if not available). This is the only case where getText() and getTextCharacters() return different values.
So based on this description, first you have to check if the current xml node is TEXT in order that getText() doesn't return null.
if (pulled.equals("preset")) {
presetName = xmlParser.getAttributeValue(null,"name");
if (xmlParser.getEventType() == XmlPullParser.TEXT) {
Log.d(TAG, presetName + " = " + xmlParser.getText());
}
}
Hope this helps,