NodeList nodeList = node.getChildNodes();
if ((nodeList.getLength() == 1) && (nodeList.item(0) instanceof Text)) {
return new ChildRegion(parent, node.getNodeValue());
} else if (node instanceof Element) {
Element element = (Element)node;
ParentRegion region = new ParentRegion(parent,
element.getNodeName());
for (int i = 0; i < nodeList.getLength(); ++i) {
Node domNode = nodeList.item(i);
if (domNode instanceof Element) {
Region child = parseElement(region, (Element)domNode);
if (child != null) {
region.addChild(child);
}
}
}
return region;
} else {