<commit_before>var _ = require("lodash");
var XMLSerializer = require("xmldom").XMLSerializer;
var xmlSerializer = new XMLSerializer();

module.exports = xmldom2xml;

var xmldom2xml = function(xmlDOM) {
  // TODO: Find a better node collection test than looking for nodeName
  if (!xmlDOM.nodeName) {
    var results = [];

    _.each(xmlDOM, function(node) {
      results.push(xmlSerializer.serializeToString(node));
    });

    return results;
  } else {
    return xmlSerializer.serializeToString(xmlDOM);
  }
};<commit_msg>Fixed export order<commit_after>var _ = require("lodash");
var XMLSerializer = require("xmldom").XMLSerializer;
var xmlSerializer = new XMLSerializer();

var xmldom2xml = function(xmlDOM) {
  // TODO: Find a better node collection test than looking for nodeName
  if (!xmlDOM.nodeName) {
    var results = [];

    _.each(xmlDOM, function(node) {
      results.push(xmlSerializer.serializeToString(node));
    });

    return results;
  } else {
    return xmlSerializer.serializeToString(xmlDOM);
  }
};

module.exports = xmldom2xml;
{'fraction_non_alphanumeric': 0.12229539040451552, 'fraction_numerical': 0.0037629350893697085, 'mean_word_length': 4.241379310344827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6968949', 'n_tokens_mistral': 327, 'n_tokens_neox': 320, 'n_words': 76}