public static String builDOMMethodStructureString(XMLStreamReader xmlsr)
			throws XMLStreamException {
		int deepLevel = 0;
		String builderDOMStructure = "<root>";

		int eventType;
		while (xmlsr.hasNext()) {
			eventType = xmlsr.next();

			if (eventType == XMLEvent.END_ELEMENT
					&& xmlsr.getLocalName().matches("^function[_A-Za-z]*$")
					&& deepLevel == 0) {
				break;
			}

			// build ur DOM string
			switch (eventType) {
			case XMLEvent.START_ELEMENT:
				builderDOMStructure += "<" + xmlsr.getLocalName() + ">";

				++deepLevel;
				break;
			case XMLEvent.END_ELEMENT:
				builderDOMStructure += "</" + xmlsr.getLocalName() + ">";

				--deepLevel;
				break;

			case XMLEvent.CHARACTERS:
				builderDOMStructure += StringEscapeUtils.escapeXml(xmlsr
						.getText());
				break;

			default:

				break;
			}

			// just for method
			if (eventType == XMLEvent.END_ELEMENT
					&& xmlsr.getLocalName().equals("parameter_list")) {
				break;
			}
		}

		return builderDOMStructure + "</root>";
	}