public static String toXML(SolrInputDocument doc) { StringWriter str = new StringWriter(); try { writeXML(doc, str); } catch (Exception ex) { } return str.toString(); }