private void build(Document doc,Node file){
  Element pieces=doc.createElement("pieces");
  pieces.setAttribute("type",type);
  pieces.setAttribute("length",String.valueOf(length));
  file.appendChild(pieces);
  for (  String hash : this.hash)   appendTextElement(doc,pieces,"hash",hash);
}

private void build ( Document doc , Node file ) { Element pieces = doc . createElement ( "pieces" ) ; pieces . setAttribute ( "type" , type ) ; pieces . setAttribute ( "length" , String . valueOf ( length ) ) ; file . appendChild ( pieces ) ; for ( String hash : this . hash ) appendTextElement ( doc , pieces , "hash" , hash ) ; }
creates a new pieces element and appends it to a file node .
