private IConstructor convertElement(Element e, boolean trim) {
IListWriter kids = vf.listWriter(Factory.Node);
for (Object o: e.getAttributes()) {
Attribute attr = (Attribute)o;
IString key = vf.string(attr.getName());
IString val = vf.string(attr.getValue());
kids.insert(vf.constructor(Factory.Node_attribute, convertNamespace(attr.getNamespace()), key, val));
}
int len = e.getContentSize();
for (int i = 0; i < len; i++) {
try {
kids.append(convertContent(e.getContent(i), trim));
}
catch (Skip c) { // Ugh, terrible, but I'm in hurry
continue;
}
}
IString name = vf.string(e.getName());
return vf.constructor(Factory.Node_element, convertNamespace(e.getNamespace()), name, kids.done());
}