def xml_document(obj)
      case obj
      when XML::Document
        XML::Document.document(obj)
      else
        XML::Document.new('1.0')
      end
    end
def xml_document(obj)
      case obj
      when XML::Document
        XML::Document.document(obj)
      else
        XML::Document.new('1.0')
      end
    end
Creates and returns a new XML document

 @param [XML::Document,String] obj Object to create the document with
 @return [XML::Document]