Return XML for these tags. This method uses the Builder library.
 The only parameter ist the builder object.
4624
def to_xml(options = {})
      xml = options[:builder] ||= Builder::XmlMarkup.new
      xml.instruct! unless options[:skip_instruct]
      each do |key, value|
        # Remove leading and trailing whitespace from tag values
        xml.tag(:k => key, :v => coder.decode(value.strip)) unless value.blank?
      end unless empty?
    end
88601
def _xml_to_dict(self, element):
        
        return_dict = {}
        for el in element:
            return_dict[el.tag] = None
            children = el.getchildren()
            if children:
                return_dict[el.tag] = self._xml_to_dict(children)
            else:
                return_dict[el.tag] = el.text
        return return_dict
1142160
def _get_aliases(self):
        
        """
        if self._aliases is None:
            self._aliases = {}

            if self._xml is not None:
                for child in self._xml.iterchildren():
                    self._aliases[helpers.normalize_tag(child.tag)] = child.tag

        return self._aliases
648306
def element(self, *args, **kwargs):
        
        child_element = self._element.add_element(*args, **kwargs)
        return Builder(child_element)
1083938
def find_tags_from_xml(
        self, xml_name, tag_name, **attribute_filter
    ):
        
        xml = self.xml[xml_name]
        if xml is None:
            return []
        if xml.tag == tag_name:
            if self.is_tag_matched(
                xml.tag, **attribute_filter
            ):
                return [xml]
            return []
        tags = xml.findall(".//" + tag_name)
        return [
            tag for tag in tags if self.is_tag_matched(
                tag, **attribute_filter
            )
        ]
590025
def XML(uri, tc, ps, **keywords):
    '''
    '''
    source = urllib.urlopen(uri, **keywords)
    enc = source.info().getencoding()
    if enc in ['7bit', '8bit', 'binary']:
        data = source
    else:
        data = StringIO.StringIO()
        mimetools.decode(source, data, enc)
        data.seek(0)
    dom = ps.readerclass().fromStream(data)
    return _child_elements(dom)[0]
1289438
def find_tags(self, tag_name, **attribute_filter):
        
        all_tags = [
            self.find_tags_from_xml(
                i, tag_name, **attribute_filter
            )
            for i in self.xml
        ]
        return [tag for tag_list in all_tags for tag in tag_list]
1169364
public String toXML()
    {
        String eol = System.getProperty("line.separator");
        RepositoryTags tags = RepositoryTags.getInstance();

        // The result
        String result = "     ";

        switch (this.fieldSource)
        {
            case SOURCE_FIELD :
                result += " " + tags.getOpeningTagNonClosingById(RUNTIME_ARGUMENT);
                result += " " + tags.getAttribute(FIELD_REF, this.fieldRefName);
                result += " " + tags.getAttribute(RETURN, String.valueOf(this.returnedByProcedure));
                result += "/>";
                break;
            case SOURCE_VALUE :
                result += " " + tags.getOpeningTagNonClosingById(CONSTANT_ARGUMENT);
                result += " " + tags.getAttribute(VALUE, this.constantValue);
                result += "/>";
                break;
            case SOURCE_NULL :
                result += " " + tags.getOpeningTagNonClosingById(RUNTIME_ARGUMENT);
                result += "/>";
                break;
            default :
                break;
        }

        // Return the result.
        return (result + eol);
    }
1216204
def getElements(self,name=''):
		''
		#If no tag name is specified, return the all children
		if not name:
			return self.children
		else:
			# else return only those children with a matching tag name
			elements = []
			for element in self.children:
				if element.name == name:
					elements.append(element)
			return elements
502704
def readXML(self):
        
        ref = self.readInteger(False)

        if ref & REFERENCE_BIT == 0:
            return self.context.getObject(ref >> 1)

        xmlstring = self.stream.read(ref >> 1)

        x = xml.fromstring(xmlstring)
        self.context.addObject(x)

        return x
1122449
def as_xml(self):
        
        # Build tree
        spacing = ("\n" if (self.pretty_xml) else "")
        root = Element('error', {'xmlns': I3F_NS})
        root.text = spacing
        e_parameter = Element('parameter', {})
        e_parameter.text = self.parameter
        e_parameter.tail = spacing
        root.append(e_parameter)
        if (self.text):
            e_text = Element('text', {})
            e_text.text = self.text
            e_text.tail = spacing
            root.append(e_text)
        # Write out as XML document to return
        tree = ElementTree(root)
        xml_buf = io.BytesIO()
        if (sys.version_info < (2, 7)):
            tree.write(xml_buf, encoding='UTF-8')
        else:
            tree.write(xml_buf, encoding='UTF-8',
                       xml_declaration=True, method='xml')
        return(xml_buf.getvalue().decode('utf-8'))
500315
def xml(self, indent=4, **kwargs):
        
        writer = StringIO()
        self.write(writer, indent=indent, **kwargs)
        return writer.getvalue()
1279307
def to_xml(options = {})
      builder = options[:builder] || XML.new("<#{self.class.member_name}/>")
      xml_keys.each { |key|
        value = respond_to?(key) ? send(key) : self[key]
        node = builder.add_element key

        # Duck-typing here is problematic because of ActiveSupport's #to_xml.
        case value
        when Resource, Subscription::AddOns
          value.to_xml options.merge(:builder => node)
        when Array
          value.each do |e|
            if e.is_a? Recurly::Resource
              # create a node to hold this resource
              e_node = node.add_element Helper.singularize(key)
              # serialize the resource into this node
              e.to_xml(options.merge(builder: e_node))
            else
              # it's just a primitive value
              node.add_element(Helper.singularize(key), e)
            end
          end
        when Hash, Recurly::Money
          value.each_pair { |k, v| node.add_element k.to_s, v }
        else
          node.text = value
        end
      }
      builder.to_s
    end
1114073
protected XmlEmit getXml() throws Throwable {
    final XmlEmit xml = new XmlEmit();

    for (final String ns: nameSpaces) {
      addNs(xml, ns);
    }

    return xml;
  }
1289887
def to_xml(params = {})
      params[:fields] ||= []
      params.reverse_merge!(:name => self.class.tag_name, :namespace => self.class.roxml_namespace)
      params[:namespace] = nil if ['*', 'xmlns'].include?(params[:namespace])
      node = XML.new_node([params[:namespace], params[:name]].compact.join(':')).tap do |root|
        refs = (self.roxml_references.present? \
          ? self.roxml_references \
          : self.class.roxml_attrs.map {|attr| attr.to_ref(self) })

        if params[:fields].length > 0
          refs.reject! { |r| !params[:fields].include?(r.name) }
        end
        refs.each do |ref|
          value = ref.to_xml(self)
          unless value.nil?
            ref.update_xml(root, value)
          end
        end
      end
    end
1188415
public String toXML()
    {
        RepositoryTags tags = RepositoryTags.getInstance();
        String eol = SystemUtils.LINE_SEPARATOR;

        StringBuffer strReturn = new StringBuffer( 1024 );
        strReturn.append( eol );
        strReturn.append( "  <!-- Descriptor for Connection " );
        strReturn.append( getProtocol() );
        strReturn.append( ":" );
        strReturn.append( getSubProtocol() );
        strReturn.append( ":" );
        strReturn.append( getDbAlias() );
        strReturn.append( " -->" );
        strReturn.append( eol );

        strReturn.append( "  " );
        strReturn.append( tags.getOpeningTagNonClosingById( JDBC_CONNECTION_DESCRIPTOR ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( JCD_ALIAS, this.getJcdAlias() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( DEFAULT_CONNECTION, "" + this.isDefaultConnection() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( DBMS_NAME, this.getDbms() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( JDBC_LEVEL, "" + this.getJdbcLevel() ) );
        strReturn.append( eol );

        //username is optional
        String user = getUserName();
        if( user != null )
        {
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( USER_NAME, user ) );
            strReturn.append( eol );
        }
        // password is optional
        String passwd = getPassWord();
        if( passwd != null )
        {
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( USER_PASSWD, passwd ) );
            strReturn.append( eol );
        }

        // JDBC Datasource or DriverManager information are alternatives:
        String dsn = getDatasourceName();
        if( dsn != null )
        {
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( DATASOURCE_NAME, this.getDatasourceName() ) );
            strReturn.append( eol );
        }
        else
        {
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( DRIVER_NAME, this.getDriver() ) );
            strReturn.append( eol );
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( URL_PROTOCOL, this.getProtocol() ) );
            strReturn.append( eol );
            strReturn.append( "    " );
            strReturn.append( tags.getAttribute( URL_SUBPROTOCOL, this.getSubProtocol() ) );
            strReturn.append( eol );
            strReturn.append( "    " );
            strReturn.append( encode( tags.getAttribute( URL_DBALIAS, this.getDbAlias() ) ) );
            strReturn.append( eol );
        }
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( EAGER_RELEASE, "" + this.getEagerRelease() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( BATCH_MODE, "" + this.getBatchMode() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( USE_AUTOCOMMIT, "" + this.getUseAutoCommit() ) );
        strReturn.append( eol );
        strReturn.append( "    " );
        strReturn.append( tags.getAttribute( IGNORE_AUTOCOMMIT_EXCEPTION, "" + this.isIgnoreAutoCommitExceptions() ) );
        strReturn.append( eol );

        strReturn.append( "  >" );
        strReturn.append( eol );
        strReturn.append( eol );

        strReturn.append( this.getConnectionPoolDescriptor().toXML() );
        strReturn.append( eol );
        if( this.getSequenceDescriptor() != null )
        {
            strReturn.append( this.getSequenceDescriptor().toXML() );
        }
        strReturn.append( eol );
        strReturn.append( "  " );
        strReturn.append( tags.getClosingTagById( JDBC_CONNECTION_DESCRIPTOR ) );
        strReturn.append( eol );
        return strReturn.toString();
    }
35193
def toxml(self):
        

        return '<ComponentRequirement name="{0}"'.format(self.name) + '' + \
            (' description = "{0}"'.format(self.description) if self.description else '') +\
            '/>'