This method will print out the XML from the current position of
<code>vn</code>. Very useful for debugging.
14943
public static String getElementFragmentAsString(byte[] b, VTDNav vn) throws NavException {
        long l = vn.getElementFragment();
        int offset = (int) l;
        int len = (int) (l >> 32);
        String elementFragment = new String(Arrays.copyOfRange(b, offset, offset + len));
        return elementFragment;
    }
483987
public void toXml(final OptionElement root, final OutputStream str) throws OptionsException {
    Writer wtr = null;

    try {
      XmlEmit xml = new XmlEmit(true);

      wtr = new OutputStreamWriter(str);
      xml.startEmit(wtr);

      xml.openTag(outerTag);

      for (OptionElement oe: root.getChildren()) {
        childToXml(oe, xml);
      }

      xml.closeTag(outerTag);
    } catch (OptionsException ce) {
      throw ce;
    } catch (Throwable t) {
      throw new OptionsException(t);
    } finally {
      if (wtr != null) {
        try {
          wtr.close();
        } catch (Throwable t) {}
      }
    }
  }
1017864
private void printChildDeclaration(NodeDefinitionData nodeDefinition, OutputStreamWriter out) throws IOException,
      RepositoryException
   {
      out.write("\r\n  ");
      out.write("+ " + qNameToString(nodeDefinition.getName()) + " ");

      InternalQName[] requiredTypes = nodeDefinition.getRequiredPrimaryTypes();
      if (requiredTypes != null && requiredTypes.length > 0)
      {
         /** if there is only 1 element and it is NT_BASE then avoid printing it */
         if (requiredTypes.length > 1 || !requiredTypes[0].equals(Constants.NT_BASE))
         {
            out.write("(" + qNameToString(requiredTypes[0]));
            for (int i = 1; i < requiredTypes.length; i++)
            {
               out.write(", " + qNameToString(requiredTypes[i]));
            }
            out.write(")");
         }
      }

      if (nodeDefinition.getDefaultPrimaryType() != null)
      {
         out.write("\r\n    = " + qNameToString(nodeDefinition.getDefaultPrimaryType()));
      }

      StringBuilder attributes = new StringBuilder();

      if (nodeDefinition.isAutoCreated())
      {
         attributes.append("autocreated ");
      }
      if (nodeDefinition.isMandatory())
      {
         attributes.append("mandatory ");
      }
      if (nodeDefinition.isProtected())
      {
         attributes.append("protected ");
      }
      if (nodeDefinition.isAllowsSameNameSiblings())
      {
         attributes.append("sns ");
      }

      if (nodeDefinition.getOnParentVersion() != OnParentVersionAction.COPY)
      {
         attributes.append("\r\n    " + OnParentVersionAction.nameFromValue(nodeDefinition.getOnParentVersion()) + " ");
      }

      if (attributes.length() > 0)
      {
         out.write("\r\n    ");
         out.write(attributes.toString());
      }

   }
712756
def dumptree(self, pn):
        
        page = self.readpage(pn)
        print("%06x: preceeding = %06x, reccount = %04x" % (pn, page.preceeding, page.count))
        for ent in page.index:
            print("    %s" % ent)
        if page.preceeding:
            self.dumptree(page.preceeding)
            for ent in page.index:
                self.dumptree(ent.page)
955768
final public void println(float v)
  {
    String s = String.valueOf(v);
    
    write(s, 0, s.length());
    println();
  }
1219972
public String toXmlString() throws TransformerException {
        if (doc == null) {
            return null;
        }
        final DOMSource domSource = new DOMSource(doc);
        final StringWriter writer = new StringWriter();
        final StreamResult result = new StreamResult(writer);
        final TransformerFactory tf = TransformerFactory.newInstance();
        tf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
        final Transformer transformer = tf.newTransformer();
        transformer.setOutputProperty(OutputKeys.ENCODING, StandardCharsets.UTF_8.name());
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "yes");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
        transformer.transform(domSource, result);

        return writer.toString();
    }
1323640
static String toXmlString(Node node) {
        try {
            Transformer transformer = getTF().newTransformer();
            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            transformer.setOutputProperty(OutputKeys.INDENT, "no");
            StringWriter sw = new StringWriter();
            StreamResult result = new StreamResult(sw);
            DOMSource source = new DOMSource(node);
            transformer.transform(source, result);
            return sw.toString();
        } catch (Exception e) {
            throw wrap(e);
        }
    }
466899
public void printScreen(BaseScreen screen, PrintWriter out)
    {
        try {
            ResourceBundle reg = ((BaseApplication)this.getTask().getApplication()).getResources(HtmlConstants.XML_RESOURCE, false);
            String string = XmlUtilities.XML_LEAD_LINE;
            out.println(string);
        
            String strStylesheetPath = screen.getScreenFieldView().getStylesheetPath();
            if (strStylesheetPath != null)
            {
                string = "<?xml-stylesheet type=\"text/xsl\" href=\"" + strStylesheetPath + "\" ?>";
                out.println(string);
            }
            out.println(Utility.startTag(XMLTags.CONTENT_AREA));
        
            screen.printScreen(out, reg);
        
            out.println(Utility.endTag(XMLTags.CONTENT_AREA));
        } catch (DBException ex) {
            ex.printStackTrace();
        }
    }
1031584
protected void printNode()
	{
		System.out.println(this.depth+", "+this.splitAttribute+", "+this.splitValue+", "+this.r);
		
		if(this.internalNode)
		{
			this.right.printNode();
			this.left.printNode();
		}
	}
192623
void asPresentationML(XmlPrintStream out) {
    out.openElement(getMessageMLTag(), getAttributes());

    for (Element child : getChildren()) {
      child.asPresentationML(out);
    }

    out.closeElement();
  }
477105
public XMLString xstr()
  {
    if(null == m_xmlStr)
      m_xmlStr = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot);
    
    return m_xmlStr;
  }
1282780
public void printXMLHeaderInfo(PrintWriter out, ResourceBundle reg)
    {
        String strTitle = this.getProperty("title");                // Menu page
        if ((strTitle == null) || (strTitle.length() == 0))
            strTitle = ((BasePanel)this.getScreenField()).getTitle();
        out.println(Utility.startTag(XMLTags.TITLE) + strTitle + Utility.endTag(XMLTags.TITLE));
        String strKeywords = this.getKeywords();
        if ((strKeywords != null) && (strKeywords.length() > 0))        
            out.println(Utility.startTag(XMLTags.META_KEYWORDS) + strKeywords + Utility.endTag(XMLTags.META_KEYWORDS));
        String strDescription = strTitle;
        out.println(Utility.startTag(XMLTags.META_DESCRIPTION) + strDescription + Utility.endTag(XMLTags.META_DESCRIPTION));
        String redirect = this.getMetaRedirect();
        if ((redirect != null) && (redirect.length() > 0))
            out.println(Utility.startTag(XMLTags.META_REDIRECT) + redirect + Utility.endTag(XMLTags.META_REDIRECT));        
    }
54749
public String getXml() {
        try {
            return ((ByteArrayOutputStream) outputStream).toString(StandardCharsets.UTF_8.name());
        } catch (UnsupportedEncodingException e) {
            return outputStream.toString();
        }
    }
1303689
public String toXML() {
        Error error = getError();

        if (error != null) {
            return error.toXML();
        }

        StringWriter sw = new StringWriter();
        String xml = "";

        try {
            JAXBContext context = JAXBContext.newInstance(this.getClass());
            Marshaller marshaller = context.createMarshaller();

            marshaller.marshal(this, sw);
            xml = sw.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return xml;
    }
1193416
public void printXmlHeader(PrintWriter out, ResourceBundle reg)
    {
        String strTopMenu = reg.getString("xmlHeader");
        if ((strTopMenu == null) || (strTopMenu.length() == 0))
            strTopMenu =
                " <top-menu>" +
                "   <menu-item>" +
                "       <description>Site home page</description>" +
                "       <link>?menu=Main</link>" +
                "       <image>Home</image>" +
                "       <name>Home</name>" +
                "   </menu-item>" +
                "   <menu-item>" +
                "       <description>My home</description>" +
                "       <link>?menu=</link>" +
                "       <image>MyHome</image>" +
                "   </menu-item>" +
                "   <menu-item>" +
                "       <description>View or change preferences</description>" +
                "       <link>" + HtmlConstants.SERVLET_LINK+ "?screen=org.jbundle.main.screen.UserPreferenceScreen&amp;java=no</link>" +
                "       <image>Lookup</image>" +
                "       <name>Preferences</name>" +
                "   </menu-item>" +
                "   <menu-item>" +
                "       <description>About us</description>" +
                "       <link>" + '?' + DBParams.HELP + '=' + "&amp;xml=docs/com/aboutus.xml</link>" +
                "       <image>About</image>" +
                "   </menu-item>" +
                "   <help-item>" +
                "       <menu-item>" +
                "           <description>Help for the current screen</description>" +
                "           <link>" + '?' + DBParams.HELP + '=' + "&amp;{url}&amp;class={helpclass}</link>" +
                "           <image>Help</image>" +
                "       </menu-item>" +
                "   </help-item>" +
                " </top-menu>";
        
        String strTitle = this.getProperty(XMLTags.TITLE);                // Menu page
        if ((strTitle == null) || (strTitle.length() == 0))
            strTitle = ((BasePanel)this.getScreenField()).getTitle();
        String strURL = this.getThisURL();
        if (strURL == null)
            strURL = DBConstants.BLANK;
        if (strURL.length() > 0)
            if (strURL.charAt(0) == '?')
                strURL = strURL.substring(1); // Always
        strURL = Utility.encodeXML(strURL);   // Convert < to &lt; , etc.

        Hashtable<String,Object> ht = new Hashtable<String,Object>();
        ht.put("helpclass", HelpScreen.class.getName());
        ht.put(XMLTags.URL, strURL);
        ht.put(XMLTags.TITLE, strTitle);
        String strUserName = this.getProperty(DBParams.USER_NAME);
        if (strUserName == null)
            strUserName = DBConstants.BLANK;
//x        ht.put(XMLTags.USER_NAME, strUserName);  // This is available in /full-screen/params/user
        String strLogin = "Login";
        if (strUserName.length() > 0)
            strLogin = "Logout";
        ht.put("loginIcon", strLogin);
        ht.put("loginDesc", reg.getString(strLogin));
        String strLoginLink = "?screen=" + UserInfoModel.USER_LOGIN_SCREEN_CLASS + "&amp;java=no";
        if (strUserName.length() > 0)
            strLoginLink = "?user=&amp;menu=";
        ht.put("loginLink", strLoginLink);
        
        strTopMenu = Utility.replaceResources(strTopMenu, reg, ht, null);

        out.println(strTopMenu);
    }
377114
public static String node2String(final Node node, boolean prettyPrint) throws UnsupportedEncodingException
   {
      return node2String(node, prettyPrint, Constants.DEFAULT_XML_CHARSET);
   }
982492
public java.lang.String getXmlns() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.xmlns);

    }