}
private void writeNode(final JsonGenerator jg, Node invert) throws IOException {
jg.writeStartObject();
for (final Map.Entry<String, NodeValue> entry : invert.entrySet()) {
NodeValue nodeValue = entry.getValue();
if (nodeValue.isList() && nodeValue.list().size() > 0) {
jg.writeFieldName(entry.getKey());
List<Node> list = nodeValue.list();
boolean array = list.size() > 1;
if (array) jg.writeStartArray();
for (Node node : list) {
writeNode(jg, node);
}
if (array) jg.writeEndArray();
} else {
String value = nodeValue.value();
if (value != null) {
jg.writeFieldName(entry.getKey());
try {
double v = Double.parseDouble(value);
jg.writeNumber(v);