docs: RDFNode parseValue() throws SparqlException, XMLStreamException {
      if (reader.nextTag() != START_ELEMENT) throw new SparqlException("No value in variable binding");
      Element elt = Element.valueOf(reader.getLocalName().toUpperCase());
      try {
        switch (elt) {
        case URI:
          if (reader.next() != CHARACTERS) throw new SparqlException("Unexpected data in URI binding");
          return new NamedNodeImpl(new URI(reader.getText()));
        case BNODE:
          if (reader.next() != CHARACTERS) throw new SparqlException("Unexpected data in BNode binding");
          return new BlankNodeImpl(reader.getText());
        case LITERAL:
          String dt = reader.getAttributeValue(null, DATATYPE);
          URI datatype = (dt == null) ? null : new URI(dt);
          String lang = reader.getAttributeValue(XML_NS, LANG);
          if (reader.next() != CHARACTERS) throw new SparqlException("Unexpected data in Literal binding");
          String lex = reader.getText();
          return (datatype != null) ? new TypedLiteralImpl(lex, datatype) : new PlainLiteralImpl(lex, lang);
        default:
          throw new SparqlException("Unexpected binding value: " + reader.getLocalName());
        }
      } catch (URISyntaxException e) {
        e.printStackTrace();
        throw new SparqlException("Bad URI in binding: " + e.getMessage());
      } catch (Throwable t) {
        t.printStackTrace();
        throw new SparqlException(t);
      } finally {
        testClose(reader.nextTag(), elt, "Bad close of value in binding");
      }
    }