try {
String xmlText = (String) ScriptableObject.callMethod(xmlObj, "toXMLString", new Object[] {});
doc = DocumentHelper.parseText(xmlText);
}
catch (DocumentException e) {
throw new ExpressionEngineException("Error parsing TMLScript xml object", e);
}
return doc.getRootElement().selectNodes(xpath);
}