private static void exportNode(final Node node, final BufferedWriter writer, final boolean force) throws IOException{
        if (!node.isModified() && !force) {
            return;
        }
        final StringBuilder nodeString = new StringBuilder();
        nodeString.append("  ");
        nodeString.append("<node");
        nodeString.append(" id='").append(node.getId()).append("'");
        if (node.isModified()){
            nodeString.append(" action='").append("modify").append("'");
        }
        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH);
        nodeString.append(" timestamp='").append(sdf.format(new Date(node.getTimestamp()))).append("'");
        if (node.getUser() != null) {
            nodeString.append(" uid='").append(node.getUser().getId()).append("'");
            nodeString.append(" user='").append(StringEscapeUtils.escapeXml(node.getUser().getName())).append("'");
        }
        nodeString.append(" visble='true'");
        nodeString.append(" version='").append(node.getVersion()).append("'");
        nodeString.append(" changeset='").append(node.getChangeset()).append("'");
        nodeString.append(" lat='").append(node.getLat()).append("'");
        nodeString.append(" lon='").append(node.getLon()).append("'");
        
        if (node.getNumTags() > 0){
            nodeString.append(">\n");
            
            final Set<String> tags = node.getTagKeys();
            for (String key: tags){
                nodeString.append("    ");
                nodeString.append("<tag");
                nodeString.append(" k='").append(StringEscapeUtils.escapeXml(key)).append("'");
                nodeString.append(" v='").append(StringEscapeUtils.escapeXml(node.getTag(key))).append("'");
                nodeString.append("/>\n");
            }
            nodeString.append("  </node>\n");
            
        }
        else {
            nodeString.append("/>\n");
        }
        
        
       
        
        writer.write(nodeString.toString());
    }