Node msgTextNode = msgNode.getFirstChild(); String msg; if(msgTextNode != null) msg = msgTextNode.getNodeValue(); else msg = "";  List paths = new ArrayList();
List paths = new ArrayList();
	public static CmdLineLogMessage[] createLogMessages(byte[] cmdLineResults) throws SVNClientException {		Collection logMessages = new ArrayList();				try {			// Create a builder factory			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();			factory.setValidating(false);    			// Create the builder and parse the file			InputSource source = new InputSource(new ByteArrayInputStream(cmdLineResults));			Document doc = factory.newDocumentBuilder().parse(source);						// This is the XML we need to parse			// --verbose mode:			//			<logentry revision="5">			//				<author>Jesper</author>			//				<date>2005-06-18T10:42:52.338920Z</date>			//				<paths>			//					<path action="A">/trunk/Subclipse-test/org</path>			//					<path action="A">/trunk/Subclipse-test/org/tigris</path>			//				</paths>			//				<msg>This one is really really cool, too!</msg>			//			</logentry>						// Not --verbose mode:			//			<logentry revision="5">			//				<author>Jesper</author>			//				<date>2005-06-18T10:42:52.338920Z</date>			//				<msg>This one is really really cool, too!</msg>			//			</logentry>						NodeList nodes = doc.getElementsByTagName("logentry");						for(int i = 0; i < nodes.getLength(); i++) {				Node logEntry = nodes.item(i);								Element authorNode = getFirstNamedElement(logEntry, "author");				if (authorNode == null) throw new Exception("'author' tag expected under 'logentry'");								Element dateNode = getNextNamedElement(authorNode, "date");				if (dateNode == null) throw new Exception("'date' tag expected under 'logentry'");				Element pathsNode = getNextNamedElement(dateNode, "paths");				Element msgNode = getNextNamedElement(pathsNode != null ? pathsNode : dateNode, "msg");				Node revisionAttribute = logEntry.getAttributes().getNamedItem("revision");                SVNRevision.Number rev = Helper.toRevNum(revisionAttribute.getNodeValue());				String author = authorNode.getFirstChild().getNodeValue();				Date date = Helper.convertXMLDate(dateNode.getFirstChild().getNodeValue());				Node msgTextNode = msgNode.getFirstChild();                String msg;				if(msgTextNode != null)					msg = msgTextNode.getNodeValue();				else					msg = "";				List paths = new ArrayList();				Element pathNode = getFirstNamedElement(pathsNode, "path");				while (pathNode != null) {                	String path = pathNode.getFirstChild().getNodeValue();                	NamedNodeMap attributes = pathNode.getAttributes();                	char action = attributes.getNamedItem("action").getNodeValue().charAt(0);                	Node copyFromPathNode = attributes.getNamedItem("copyfrom-path");                	Node copyFromRevNode = attributes.getNamedItem("copyfrom-rev");                	String copyFromPath = null;                	if (copyFromPathNode != null) {                		copyFromPath = copyFromPathNode.getNodeValue();                	}                	SVNRevision.Number copyFromRev = null;                	if (copyFromRevNode != null) {                		copyFromRev = Helper.toRevNum(copyFromRevNode.getNodeValue());                	}                    paths.add(new SVNLogMessageChangePath(                            path, copyFromRev, copyFromPath, action));					                    pathNode = getNextNamedElement(pathNode, "path");                }				ISVNLogMessageChangePath[] logMessageChangePath = (ISVNLogMessageChangePath[])paths.toArray(new ISVNLogMessageChangePath[paths.size()]);					                CmdLineLogMessage logMessage = new CmdLineLogMessage(rev, author, date, msg, logMessageChangePath);				logMessages.add(logMessage);							}		} catch (Exception e) {			throw new SVNClientException(e);		} 				return (CmdLineLogMessage[]) logMessages.toArray(new CmdLineLogMessage[logMessages.size()]);				}