# Interface: com.pnfsoftware.jeb.core.units.IXmlUnit

Units providing XML documents are encouraged to implement this interface.

## Method: getDocument
- return type: `org.w3c.dom.Document`

Description: Retrieve the org.w3c.dom.XML document object. Watch out: per the W3C specifications, the returned tree object is not thread\-safe, even for exclusive read operations. However, if the implementation returned is JEB's [XDocument](XDocument), then it is thread\-safe.
return: the XML document root

## Method: getDocumentAsText
- return type: `java.lang.String`

Description: This convenience method can be used to retrieve an XML formatted version of this document.
return: an XML text string, null if parsing this XML unit resulted in errors

## Method: getItemObject
- parameter: `id`, type: `long`
- return type: `java.lang.Object`

Description: 
return: if the item id refers to a non\-attribute value node, the return value is an         `org.w3c.dom.Node` object; if the item id refers to an attribute value, the         return value is a 2\-element array containing: the `org.w3c.dom.Attr` node         object; the attribute value as a `String` object

## Method: hasXmlDeclaration
- return type: `boolean`

Description: Indicate if XML Document has the XML declaration in prolog "<?xml ... ?\>"
return: true if the XML declaration is present

